/* ==========================================================================
   Nisura Store - Authentication Pages Stylesheet
   Synchronized with Home/Index Soft Dark Functional Design System
   Locked 100vh Viewport (No Scroll)
   ========================================================================== */

:root {
  /* Core Palette: Soft Dark Charcoal & Muted Slate Blue (Identical to index.html) */
  --bg-main: #131720;
  --bg-surface: #1c2436;
  --bg-surface-elevated: #243047;
  --bg-surface-active: #2c3a56;

  /* Structural Borders (>= 3:1 interactive boundary contrast where required) */
  --border-subtle: #2a364f;
  --border-medium: #3b4c6e;
  --border-strong: #526690;
  --border-focus: #60a5fa;

  /* WCAG AA Verified Text Hierarchy */
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  /* Single Deliberate Accent: Cobalt Blue */
  --brand-red: #2563eb;
  --brand-red-hover: #1d4ed8;
  --brand-accent-text: #60a5fa;

  /* Controlled Border Radius Hierarchy */
  --radius-sm: 6px;
  --radius-md: 10px;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Motion Dial 1: Clean hover & state transitions only */
  --transition-fast: 0.16s ease;
}

:root[data-theme="light"],
[data-theme="light"] {
  --bg-main: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-surface-active: #e2e8f0;

  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-strong: #94a3b8;
  --border-focus: #2563eb;

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --brand-red: #2563eb;
  --brand-red-hover: #1d4ed8;
  --brand-accent-text: #1d4ed8;
}

[data-theme="light"] .auth-card {
  background-color: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .auth-input {
  background-color: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .auth-input:focus {
  border-color: #2563eb;
}

[data-theme="light"] .site-header {
  background-color: #ffffff;
  border-bottom-color: #e2e8f0;
}

[data-theme="light"] .nav-item {
  color: #475569;
}

[data-theme="light"] .nav-item:hover {
  color: #0f172a;
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

/* High-contrast visible focus indicator for keyboard accessibility */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* ==========================================================================
   Site Header Integration
   ========================================================================== */
.top-nav-wrapper {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background-color: #161c28;
}

[data-theme="light"] .top-nav-wrapper {
  background-color: #ffffff;
}

.site-header {
  flex-shrink: 0;
}

/* ==========================================================================
   Main Auth Container & Card (Centered in Fixed Viewport, Zero Scroll)
   ========================================================================== */
.login-container {
  flex: 1;
  width: 100%;
  max-width: 420px;
  padding: 12px 20px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px 26px;
}

.auth-card-header {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.heading-title {
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 4px;
  color: var(--text-main);
}

.heading-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ==========================================================================
   Form Fields & Controls
   ========================================================================== */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.field-label {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.field-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-accent-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.field-link:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.text-input {
  width: 100%;
  height: 40px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-main);
  transition: border-color var(--transition-fast);
}

.text-input.has-toggle {
  padding-right: 42px;
}

.text-input:focus {
  border-color: var(--border-focus);
}

.text-input::placeholder {
  color: var(--text-muted);
}

.toggle-password {
  position: absolute;
  right: 2px;
  width: 38px;
  height: 38px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.toggle-password:hover {
  color: var(--text-main);
}

/* ==========================================================================
   OTP Verification Block (Clean Flat Structure, No Box-in-Box)
   ========================================================================== */
.otp-verification-block {
  gap: 8px;
}

.otp-info-text {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 2px;
}

.otp-info-text strong {
  color: var(--brand-accent-text);
  font-weight: 600;
}

.otp-code-input {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-align: center;
  height: 46px;
}

.otp-resend-row {
  display: flex;
  justify-content: flex-end;
}

.btn-resend-otp {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-accent-text);
  cursor: pointer;
  padding: 4px 0;
  transition: color var(--transition-fast);
}

.btn-resend-otp:hover:not(:disabled) {
  color: #93c5fd;
  text-decoration: underline;
}

.btn-resend-otp:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ==========================================================================
   Checkbox & Primary Submit Action
   ========================================================================== */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.custom-check {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-red);
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
}

.check-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-submit {
  width: 100%;
  height: 42px;
  background-color: var(--brand-red);
  color: #ffffff;
  border: 1px solid #3b82f6;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-fast);
}

.btn-submit:hover:not(:disabled) {
  background-color: var(--brand-red-hover);
}

.btn-submit:disabled {
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-subtle);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* ==========================================================================
   Social Auth & Mode Switcher Footer
   ========================================================================== */
.divider {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 14px 0 12px;
}

.divider::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
  background-color: var(--border-subtle);
  z-index: 1;
}

.divider span {
  position: relative;
  z-index: 2;
  background-color: var(--bg-surface);
  padding: 0 12px;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.social-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-social {
  width: 100%;
  height: 40px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  font-family: inherit;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.btn-social:hover {
  background-color: var(--bg-surface-elevated);
  border-color: var(--border-strong);
}

.social-svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.card-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.card-footer a {
  color: var(--brand-accent-text);
  font-weight: 700;
  text-decoration: none;
}

.card-footer a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* ==========================================================================
   Status Alert Banners
   ========================================================================== */
.alert-banner {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.4;
  margin-bottom: 12px;
  display: none;
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #6ee7b7;
}

/* ==========================================================================
   Responsive Mobile Breakpoints
   ========================================================================== */
@media (max-width: 640px) {
  .container {
    padding: 0 14px;
  }

  .site-header {
    padding: 8px 0;
  }

  .header-inner nav {
    display: none;
  }

  .login-container {
    padding: 10px 14px;
  }

  .login-card {
    padding: 20px 18px;
  }
}
