/* =====================================================================
   FinPal Auth Shell
   Uses dashboard.css tokens; no Bootstrap/mobile legacy dependencies.
   ===================================================================== */

.auth-page {
  margin: 0;
  min-height: 100vh;
  background: var(--bg, #08090E);
  color: var(--text, #F4F4F5);
  overflow-x: hidden;
}

.auth-shell {
  min-height: 100vh;
  max-width: 100%;
  padding: 28px 18px 22px;
  display: flex;
  flex-direction: column;
}

.auth-frame {
  width: min(980px, 100%);
  margin: auto;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
  gap: 24px;
  align-items: center;
}

.auth-brand {
  padding: 28px;
}

.auth-logo {
  width: 82px;
  height: 82px;
  border-radius: 28px;
  display: grid;
  place-items: center;
  color: #111827;
  font-size: 34px;
  text-decoration: none;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 22px 44px rgba(167,139,250,.28);
}

.auth-kicker {
  margin: 26px 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.auth-brand h1 {
  margin: 0;
  max-width: 560px;
  font-family: 'Instrument Serif', 'Inter Tight', serif;
  font-size: clamp(42px, 7vw, 82px);
  line-height: .92;
  letter-spacing: -.04em;
  color: var(--text);
}

.auth-brand p:last-child {
  margin: 18px 0 0;
  max-width: 460px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.65;
}

.auth-panel {
  border: 1px solid var(--glass-border);
  border-radius: 34px;
  background:
    radial-gradient(circle at top left, rgba(167,139,250,.18), transparent 34%),
    linear-gradient(180deg, var(--glass-bg), rgba(15,17,24,.88));
  box-shadow: var(--shadow-pop);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 26px;
}

.auth-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.auth-card-head h2 {
  margin: 0;
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--text);
}

.auth-card-head p {
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-pill {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 8px 10px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 800;
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 18px;
  padding: 13px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
}

.auth-alert.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(251,113,133,.2);
}

.auth-alert.success {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(52,211,153,.2);
}

.auth-alert a {
  color: inherit;
  font-weight: 800;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 14px;
}

.auth-input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  padding: 0 44px;
  font-size: 15px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}

.auth-input::placeholder {
  color: var(--text-dim);
}

.auth-input:focus {
  border-color: rgba(167,139,250,.55);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.auth-input.is-invalid {
  border-color: rgba(251,113,133,.75);
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.auth-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}

.auth-error {
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.auth-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.auth-link,
.auth-inline-btn {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.auth-link:hover,
.auth-inline-btn:hover {
  color: var(--primary);
}

.auth-submit {
  min-height: 52px;
  width: 100%;
  border: 0;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #111827;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 16px 30px rgba(167,139,250,.22);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .16s var(--ease);
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 38px rgba(167,139,250,.28);
}

.auth-secondary {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.auth-secondary p {
  margin: 0 0 8px;
}

.auth-note {
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 14px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.55;
}

.auth-note strong {
  color: var(--text);
}

.auth-note ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.auth-meter {
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 4px;
}

.auth-meter > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--danger);
  transition: width .2s var(--ease), background .2s var(--ease);
}

.auth-meter-text {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.auth-dialog {
  width: min(560px, calc(100vw - 28px));
  border: 1px solid var(--border);
  border-radius: 26px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  padding: 0;
}

.auth-dialog::backdrop {
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(5px);
}

.auth-dialog-body {
  padding: 24px;
}

.auth-dialog h3 {
  margin: 0 0 12px;
  font-family: 'Inter Tight', 'Inter', sans-serif;
}

.auth-dialog p,
.auth-dialog li {
  color: var(--text-muted);
  line-height: 1.55;
  font-size: 14px;
}

.auth-dialog-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
}

.auth-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--text-dim);
  font-size: 12px;
}

@media (max-width: 820px) {
  .auth-frame {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .auth-brand {
    text-align: center;
    padding: 16px 8px 8px;
  }

  .auth-logo {
    margin: 0 auto;
    width: 66px;
    height: 66px;
    border-radius: 22px;
    font-size: 27px;
  }

  .auth-brand h1 {
    font-size: clamp(36px, 11vw, 54px);
  }

  .auth-brand p:last-child {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 440px) {
  .auth-shell {
    padding: 18px 12px;
  }

  .auth-panel {
    border-radius: 28px;
    padding: 18px;
  }

  .auth-card-head {
    display: block;
  }

  .auth-pill {
    display: inline-flex;
    margin-top: 12px;
  }

  .auth-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
