/* ============================================================
   DashAdvisr — Login Page Styles
   Only for login.html. Uses variables defined in base.css.
   ============================================================ */

/* Login page has a lighter, warmer background than the dashboard */
body {
  background: var(--theme-bg-warm, #fafaf8);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Background gradient orbs (different from dashboard gradient) */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.bg-orbs::before {
  content: '';
  position: absolute;
  top: -10%; left: -5%;
  width: 600px; height: 600px;
  background: radial-gradient(ellipse, rgba(37,99,235,0.07) 0%, transparent 65%);
}
.bg-orbs::after {
  content: '';
  position: absolute;
  bottom: -10%; right: -5%;
  width: 500px; height: 500px;
  background: radial-gradient(ellipse, rgba(26,158,110,0.06) 0%, transparent 65%);
}

/* Login card: the white box in the center */
.login-card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 40px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
  animation: fadeUp 0.5s ease both;
}


/* Logo inside the card (override base nav logo for centered layout) */
.login-card .logo {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.3px;
  margin-bottom: 32px;
  display: block;
  text-decoration: none;
}
.login-card .logo span { color: var(--accent); }

/* Headings */
.login-heading {
  font-family: 'Instrument Serif', serif;
  font-size: 30px;
  letter-spacing: -0.8px;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.15;
}
.login-sub {
  font-size: 14px;
  color: var(--ink-muted);
  margin-bottom: 32px;
}

/* Form */
.form-group { margin-bottom: 16px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

input {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--theme-input-bg, #fff);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-font-smoothing: antialiased;
}
input::placeholder { color: var(--ink-muted); }
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
input.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(212,58,58,0.08);
}

/* Password row (label + forgot link on same line) */
.password-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.forgot-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 4px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.forgot-link:hover { text-decoration: underline; }

/* Inline field error messages */
.error-msg { font-size: 13px; color: var(--red); margin-top: 4px; display: none; }
.error-msg.visible { display: block; }

/* Alert bar (error / success messages at top of form) */
.alert {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  display: none;
}
.alert.visible { display: block; }
.alert.error   { background: rgba(212,58,58,0.07);  color: var(--red);   border: 1px solid rgba(212,58,58,0.15); }
.alert.success { background: rgba(26,158,110,0.07); color: var(--green); border: 1px solid rgba(26,158,110,0.15); }

/* Primary submit button */
.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: 0 4px 20px rgba(37,99,235,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(37,99,235,0.35);
}
.btn-submit:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

/* Loading spinner inside the submit button */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-text { opacity: 0.7; }

/* "or" divider between password login and magic link */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--ink-muted);
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Magic link / secondary button */
.btn-magic {
  width: 100%;
  padding: 13px;
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-magic:hover { border-color: var(--ink); color: var(--ink); }

/* Footer link */
.login-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 13px;
  color: var(--ink-muted);
}
.login-footer a { color: var(--accent); text-decoration: none; font-weight: 500; padding: 8px 4px; }
.login-footer a:hover { text-decoration: underline; }

/* Security badge at bottom of card */
.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  font-size: 11px;
  color: var(--ink-muted);
}
.security-badge svg { opacity: 0.5; }

/* View switcher (sign in / forgot / magic sent views) */
.view        { display: none; }
.view.active { display: block; }

/* ── Mobile responsive ── */
@media (max-width: 768px) {
  /* Swap full logo for D mark on mobile */
  .logo-full { display: none !important; }
  .logo-mark { display: inline-block !important; }
  .logo { display: flex; align-items: center; }
}
@media (max-width: 480px) {
  .bg-orbs::before { width: 300px; height: 300px; }
  .bg-orbs::after  { width: 250px; height: 250px; }
  .login-card { padding: 32px 24px; border-radius: 20px; }
  .login-heading { font-size: 26px; }
  .login-sub { margin-bottom: 24px; }
  .btn-submit { padding: 13px; font-size: 14px; }
  .btn-magic  { padding: 12px; font-size: 13px; }
  .divider { margin: 20px 0; }
}
