/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Variables ── */
:root {
  --navy:   #1a2e5a;
  --blue:   #1d3f8f;
  --accent: #2b5ce6;
  --red:    #e05a6a;
  --gray50: #f8f9fc;
  --gray100:#f0f2f8;
  --gray200:#dde1ed;
  --gray400:#9198b0;
  --gray700:#3d4466;
  --text:   #111827;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(27, 46, 90, 0.10);
}

/* ── Body ── */
body {
  font-family: 'Inter', sans-serif;
  background: var(--gray50);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-image: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(43, 92, 230, 0.10) 0%, transparent 70%);
}

/* ── Card ── */
.card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 44px 40px 40px;
  width: 100%;
  max-width: 460px;
  animation: fadeUp 0.45s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo ── */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.logo-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.3px;
}

.logo-name .ai {
  color: var(--accent);
}

/* ── Heading ── */
h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.4px;
}

.subtitle {
  font-size: 0.875rem;
  color: var(--gray400);
  margin-bottom: 28px;
}

/* ── Google button ── */
.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px;
  border: 1.5px solid var(--gray200);
  border-radius: var(--radius);
  background: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray700);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
  margin-bottom: 20px;
}

.btn-google:hover {
  background: var(--gray50);
  border-color: var(--gray400);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.btn-google svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--gray400);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray200);
}

/* ── Fields ── */
.field {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray700);
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray200);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(43, 92, 230, 0.12);
}

input.error {
  border-color: var(--red);
}

input.error:focus {
  box-shadow: 0 0 0 3px rgba(224, 90, 106, 0.12);
}

/* ── Password toggle ── */
.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--gray400);
  display: flex;
  align-items: center;
  transition: color 0.18s;
}

.toggle-pw:hover {
  color: var(--gray700);
}

.toggle-pw svg {
  width: 18px;
  height: 18px;
}

/* ── Error messages ── */
.error-msg {
  font-size: 0.775rem;
  color: var(--red);
  margin-top: 5px;
  display: none;
}

.error-msg.show {
  display: block;
}

/* ── Row: remember + forgot ── */
.row-opts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.remember input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  margin: 0;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.remember span {
  font-size: 0.85rem;
  color: var(--gray700);
  font-weight: 500;
}

.forgot {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  transition: color 0.18s;
}

.forgot:hover {
  color: var(--accent);
}

/* ── Primary button ── */
.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(29, 63, 143, 0.28);
  transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background: #16347a;
  box-shadow: 0 6px 18px rgba(29, 63, 143, 0.36);
}

.btn-primary:active {
  transform: scale(0.985);
}

/* Spinner inside primary button */
.btn-primary .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
}

.btn-primary.loading .spinner {
  display: block;
}

.btn-primary.loading {
  pointer-events: none;
}

@keyframes spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

/* ── Sign up row ── */
.signup-row {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--gray400);
}

.signup-row a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}

.signup-row a:hover {
  color: var(--accent);
}

/* ── AI Disclosure box ── */
.disclosure {
  margin-top: 28px;
  border-left: 4px solid var(--accent);
  background: var(--gray100);
  border-radius: 0 12px 12px 0;
  padding: 16px 18px 18px;
}

.disclosure p {
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--gray700);
  margin-bottom: 14px;
}

.disclosure p strong {
  color: var(--navy);
}

.btn-disclosure {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.18s, box-shadow 0.18s;
  box-shadow: 0 3px 10px rgba(43, 92, 230, 0.28);
  text-decoration: none;
}

.btn-disclosure:hover {
  background: #2250cc;
  box-shadow: 0 5px 16px rgba(43, 92, 230, 0.38);
}

.btn-disclosure svg {
  width: 14px;
  height: 14px;
  fill: #fff;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Overlays ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 50, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 100;
  padding: 24px;
}

.overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #fff;
  border-radius: 20px;
  padding: 36px 32px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  transform: scale(0.94);
  transition: transform 0.25s;
}

.overlay.open .modal {
  transform: scale(1);
}

.modal h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.modal-body p {
  font-size: 0.86rem;
  color: var(--gray400);
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* Secondary button (modal cancel) */
.btn-secondary {
  flex: 1;
  padding: 11px;
  border: 1.5px solid var(--gray200);
  border-radius: var(--radius);
  background: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray700);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.btn-secondary:hover {
  background: var(--gray50);
  border-color: var(--gray400);
}

/* Send button (modal confirm) */
.btn-send {
  flex: 1;
  padding: 11px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s;
  box-shadow: 0 3px 12px rgba(29, 63, 143, 0.28);
}

.btn-send:hover {
  background: #16347a;
}

/* ── Under Development modal ── */
.modal-center {
  text-align: center;
}

.modal-emoji {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.modal-badge {
  display: inline-block;
  margin-bottom: 14px;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffd966;
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.modal-center p {
  font-size: 0.86rem;
  color: var(--gray400);
  margin-bottom: 20px;
  line-height: 1.55;
}

.btn-close-modal {
  width: 100%;
  padding: 11px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s;
}

.btn-close-modal:hover {
  background: #16347a;
}
