/* =============================================================================
   OrbisChat – Authentication Styles
   Design: Premium SaaS · Minimalist Refined · Deep Navy + Electric Blue
   ============================================================================= */

/* ─── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ─── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  /* Brand palette */
  --blue-50:    #eff6ff;
  --blue-100:   #dbeafe;
  --blue-200:   #bfdbfe;
  --blue-400:   #60a5fa;
  --blue-500:   #3b82f6;
  --blue-600:   #2563eb;
  --blue-700:   #1d4ed8;
  --blue-800:   #1e40af;
  --blue-900:   #1e3a8a;

  /* Neutrals */
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-300:   #d1d5db;
  --gray-400:   #9ca3af;
  --gray-500:   #6b7280;
  --gray-600:   #4b5563;
  --gray-700:   #374151;
  --gray-800:   #1f2937;
  --gray-900:   #111827;

  /* Semantic */
  --color-primary:       var(--blue-600);
  --color-primary-hover: var(--blue-700);
  --color-primary-light: var(--blue-50);
  --color-success:       #16a34a;
  --color-success-bg:    #f0fdf4;
  --color-error:         #dc2626;
  --color-error-bg:      #fef2f2;
  --color-warning:       #d97706;
  --color-warning-bg:    #fffbeb;
  --color-info:          var(--blue-600);
  --color-info-bg:       var(--blue-50);

  /* Layout */
  --panel-left-bg:  #0f1724;
  --panel-right-bg: #ffffff;
  --left-width:     52%;

  /* Typography */
  --font-display: 'Sora', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --shadow-xl:  0 20px 25px rgba(0,0,0,.1), 0 10px 10px rgba(0,0,0,.04);
  --shadow-card: 0 0 0 1px rgba(0,0,0,.06), 0 8px 32px rgba(0,0,0,.08);

  /* Transitions */
  --t-fast:    150ms cubic-bezier(.4,0,.2,1);
  --t-base:    250ms cubic-bezier(.4,0,.2,1);
  --t-slow:    400ms cubic-bezier(.4,0,.2,1);
  --t-spring:  500ms cubic-bezier(.34,1.56,.64,1);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-50);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, button, select, textarea { font-family: inherit; font-size: inherit; }

/* ─── Layout ────────────────────────────────────────────────────────────────── */
.auth-root {
  display: grid;
  grid-template-columns: var(--left-width) 1fr;
  min-height: 100dvh;
}

/* ─── Left Panel ────────────────────────────────────────────────────────────── */
.panel-left {
  position: relative;
  background: var(--panel-left-bg);
  display: flex;
  flex-direction: column;
  padding: var(--space-12) var(--space-12) var(--space-10);
  overflow: hidden;
}

/* Decorative mesh gradient */
.panel-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(37,99,235,.45) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(30,64,175,.35) 0%, transparent 55%),
    radial-gradient(ellipse 50% 60% at 50% 50%, rgba(15,23,36,.9) 0%, transparent 80%);
  pointer-events: none;
}

/* Grid lines decoration */
.panel-left::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.panel-left__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: auto;
}

.logo__mark {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,.15), 0 4px 12px rgba(37,99,235,.5);
  flex-shrink: 0;
}

.logo__mark svg {
  width: 22px;
  height: 22px;
  fill: white;
}

.logo__name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
}

/* Hero content */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-16) 0 var(--space-12);
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(37,99,235,.18);
  border: 1px solid rgba(96,165,250,.25);
  color: var(--blue-200);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  width: fit-content;
  margin-bottom: var(--space-6);
}

.hero__badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--blue-400);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.8); }
}

.hero__headline {
  font-family: var(--font-display);
  font-size: clamp(1.875rem, 3vw, 2.625rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.03em;
  color: #fff;
  margin-bottom: var(--space-5);
}

.hero__headline em {
  font-style: normal;
  background: linear-gradient(120deg, #60a5fa 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__description {
  font-size: 1rem;
  color: rgba(255,255,255,.55);
  max-width: 400px;
  line-height: 1.7;
  margin-bottom: var(--space-10);
}

/* Feature pills */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: rgba(255,255,255,.65);
  font-size: 0.875rem;
}

.feature-item__icon {
  width: 30px;
  height: 30px;
  background: rgba(37,99,235,.2);
  border: 1px solid rgba(96,165,250,.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-item__icon svg {
  width: 15px;
  height: 15px;
  fill: var(--blue-400);
}

/* Illustration / visual area */
.hero__visual {
  margin-top: var(--space-12);
  position: relative;
  height: 180px;
}

/* Floating message card mockups */
.msg-card {
  position: absolute;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  animation: float 6s ease-in-out infinite;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  max-width: 280px;
}

.msg-card:nth-child(2) {
  animation-delay: -3s;
  top: 60px;
  left: 60px;
}

.msg-card:nth-child(1) {
  top: 0;
  left: 0;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}

.msg-body { flex: 1; min-width: 0; }

.msg-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,.8);
  margin-bottom: 2px;
}

.msg-text {
  font-size: 0.75rem;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Left panel footer */
.panel-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255,255,255,.07);
  margin-top: var(--space-8);
}

.panel-footer__avatars {
  display: flex;
}

.panel-footer__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--panel-left-bg);
  margin-left: -6px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-800));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  color: #fff;
}

.panel-footer__avatar:first-child { margin-left: 0; }

.panel-footer__text {
  font-size: 0.8125rem;
  color: rgba(255,255,255,.4);
}

.panel-footer__text strong {
  color: rgba(255,255,255,.7);
  font-weight: 600;
}

/* ─── Right Panel ───────────────────────────────────────────────────────────── */
.panel-right {
  background: var(--panel-right-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-8);
  position: relative;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

/* ─── View system ───────────────────────────────────────────────────────────── */
[data-view] {
  display: none;
  animation: fadeSlideUp var(--t-slow) both;
}

[data-view].view--active {
  display: block;
}

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

/* ─── Auth Header ───────────────────────────────────────────────────────────── */
.auth-header {
  margin-bottom: var(--space-8);
}

.auth-header__eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--blue-600);
  margin-bottom: var(--space-2);
}

.auth-header__title {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--gray-900);
  line-height: 1.25;
  margin-bottom: var(--space-2);
}

.auth-header__sub {
  font-size: 0.9rem;
  color: var(--gray-500);
  line-height: 1.6;
}

/* ─── Tab Nav ───────────────────────────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: var(--space-8);
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  transition: all var(--t-base);
  position: relative;
}

.auth-tab:hover {
  color: var(--gray-800);
}

.auth-tab.nav__link--active {
  background: #fff;
  color: var(--gray-900);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ─── Form fields ───────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: var(--space-5); }

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.field__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
  letter-spacing: .01em;
}

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

.field__input {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-4);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--gray-900);
  font-size: 0.9375rem;
  font-family: var(--font-body);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  outline: none;
  -webkit-appearance: none;
}

.field__input::placeholder {
  color: var(--gray-400);
}

.field__input:hover {
  border-color: var(--gray-300);
}

.field__input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  background: #fff;
}

.field__input--error {
  border-color: var(--color-error) !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,.08) !important;
}

.field__input--valid {
  border-color: var(--color-success);
  box-shadow: 0 0 0 3px rgba(22,163,74,.06);
}

/* Inputs with icon prefix */
.field__input--prefixed {
  padding-left: calc(var(--space-4) + 20px + var(--space-3));
}

.field__prefix-icon {
  position: absolute;
  left: var(--space-4);
  width: 18px;
  height: 18px;
  color: var(--gray-400);
  pointer-events: none;
  flex-shrink: 0;
}

.field__prefix-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Password toggle */
.field__input--with-toggle {
  padding-right: calc(var(--space-4) + 20px + var(--space-3));
}

.password-toggle {
  position: absolute;
  right: var(--space-4);
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast);
  padding: 0;
}

.password-toggle:hover { color: var(--gray-700); }

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Hint / error text */
.field__hint {
  font-size: 0.75rem;
  color: var(--gray-500);
  line-height: 1.4;
  min-height: 1rem;
}

.field__hint--error {
  color: var(--color-error);
}

/* Phone number country picker */
.phone-field-control,
.phone-field-control .iti {
  width: 100%;
}

.phone-field-control .iti {
  position: relative;
  display: inline-block;
}

.phone-field-control .iti__hide {
  display: none !important;
}

.phone-field-control .iti__flag-container {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.phone-field-control .iti__selected-flag {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  transition: background var(--t-fast);
}

.phone-field-control .iti__selected-flag:hover,
.phone-field-control .iti__selected-flag:focus {
  background: var(--gray-100);
}

.phone-field-control .iti--separate-dial-code .iti__selected-dial-code {
  margin-left: var(--space-2);
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 600;
}

.phone-field-control .iti--separate-dial-code .field__input {
  padding-left: 96px;
}

.phone-field-control .iti__country-list {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 10;
  width: min(360px, calc(100vw - 48px));
  max-height: min(320px, calc(100dvh - 160px));
  margin: 2px 0 0;
  padding: 0;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  background: #fff;
  color: var(--gray-700);
  list-style: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.phone-field-control .iti__country-list--dropup {
  top: auto;
  bottom: 100%;
  margin: 0 0 2px;
}

.phone-field-control .iti__country {
  padding: 8px var(--space-3);
}

.phone-field-control .iti__country-name,
.phone-field-control .iti__dial-code {
  white-space: nowrap;
}

.phone-field-control .iti__country.iti__highlight {
  background: var(--blue-50);
}

/* Password strength */
#password-strength {
  opacity: 0;
  transition: opacity var(--t-base);
}

.strength-track {
  height: 4px;
  background: var(--gray-100);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 4px;
}

.strength-bar {
  height: 100%;
  width: 0;
  border-radius: var(--radius-full);
  transition: width var(--t-base), background var(--t-base);
}

.strength-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ─── Form footer row ───────────────────────────────────────────────────────── */
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--gray-600);
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
  flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked {
  background: var(--blue-600);
  border-color: var(--blue-600);
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4L4.5 7.5L11 1' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Forgot password link */
.link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--blue-600);
  transition: color var(--t-fast);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.link:hover { color: var(--blue-700); text-decoration: underline; }

.link:disabled {
  color: var(--gray-400);
  cursor: not-allowed;
  text-decoration: none;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-6);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--t-base);
  outline: none;
  text-decoration: none;
  letter-spacing: -.01em;
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(37,99,235,.35);
}

.btn--primary {
  width: 100%;
  background: var(--blue-600);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 0 0 1px rgba(37,99,235,.2);
}

.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.08) 0%, transparent 100%);
  border-radius: inherit;
  pointer-events: none;
}

.btn--primary:hover:not(:disabled) {
  background: var(--blue-700);
  box-shadow: 0 4px 12px rgba(37,99,235,.35), 0 1px 2px rgba(0,0,0,.1);
  transform: translateY(-1px);
}

.btn--primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.btn--primary:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none !important;
}

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

/* Spinner inside button */
.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Phone auth */
.auth-step {
  display: none;
  animation: fadeSlideUp var(--t-slow) both;
}

.auth-step--active {
  display: block;
}

.account-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--gray-100);
}

.account-toggle__btn {
  min-height: 36px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid transparent;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  color: var(--gray-500);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.account-toggle__btn:hover {
  color: var(--gray-800);
}

.account-toggle__btn.active {
  background: #fff;
  color: var(--blue-700);
  box-shadow: var(--shadow-xs);
}

/* One-time passcode */
.otp-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: var(--space-2);
}

.otp-digit {
  width: 100%;
  min-width: 0;
  height: 52px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--gray-900);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.otp-digit:hover {
  border-color: var(--gray-300);
}

.otp-digit:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.otp-digit--error {
  border-color: var(--color-error);
  background: var(--color-error-bg);
  animation: otp-shake 320ms ease-in-out;
}

.otp-sep {
  color: var(--gray-300);
  font-weight: 700;
}

.otp-hint {
  display: block;
}

.otp-footer {
  margin-top: var(--space-6);
}

@keyframes otp-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}

/* Divider */
.form-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--gray-400);
  font-size: 0.8125rem;
  margin: var(--space-2) 0;
}

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

/* ─── Success state (reset form) ────────────────────────────────────────────── */
.reset-success { display: none; }

.form--success .reset-form-fields { display: none; }
.form--success .reset-success      { display: block; }

.success-icon-wrap {
  width: 56px;
  height: 56px;
  background: var(--color-success-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-5);
}

.success-icon-wrap svg {
  width: 28px;
  height: 28px;
  fill: var(--color-success);
}

.success-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  text-align: center;
  margin-bottom: var(--space-3);
  letter-spacing: -.02em;
}

.success-description {
  font-size: 0.875rem;
  color: var(--gray-500);
  text-align: center;
  line-height: 1.65;
}

.success-description strong {
  color: var(--gray-800);
  font-weight: 600;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-6);
  text-align: center;
}

/* ─── Notification / Toast ──────────────────────────────────────────────────── */
#notification-container {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 380px;
  width: calc(100vw - var(--space-10));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0,0,0,.05);
  transform: translateX(calc(100% + var(--space-5)));
  opacity: 0;
  transition: transform var(--t-spring), opacity var(--t-base);
  pointer-events: all;
}

.toast--visible {
  transform: translateX(0);
  opacity: 1;
}

.toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.toast__icon svg {
  width: 20px;
  height: 20px;
}

.toast--success .toast__icon { color: var(--color-success); }
.toast--error   .toast__icon { color: var(--color-error); }
.toast--warning .toast__icon { color: var(--color-warning); }
.toast--info    .toast__icon { color: var(--color-info); }

.toast--success { border-left: 3px solid var(--color-success); }
.toast--error   { border-left: 3px solid var(--color-error); }
.toast--warning { border-left: 3px solid var(--color-warning); }
.toast--info    { border-left: 3px solid var(--color-info); }

.toast__message {
  flex: 1;
  font-size: 0.875rem;
  color: var(--gray-700);
  line-height: 1.5;
}

.toast__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--gray-400);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast);
  padding: 0;
}

.toast__close:hover { color: var(--gray-700); }

.toast__close svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ─── Auth card footer ──────────────────────────────────────────────────────── */
.auth-card__footer {
  margin-top: var(--space-6);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

/* ─── Responsive – Tablet ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --left-width: 45%; }

  .hero__visual    { display: none; }
  .panel-left      { padding: var(--space-10) var(--space-8); }
  .hero__headline  { font-size: 1.875rem; }
}

/* ─── Responsive – Mobile ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .auth-root {
    grid-template-columns: 1fr;
    min-height: 100dvh;
  }

  .panel-left {
    display: none; /* Hidden on mobile – logo shown in header instead */
  }

  .panel-right {
    padding: var(--space-6) var(--space-5);
    background: var(--gray-50);
    align-items: flex-start;
    padding-top: var(--space-10);
  }

  .auth-card {
    max-width: 100%;
    background: #fff;
    border-radius: var(--radius-xl);
    padding: var(--space-8) var(--space-6);
    box-shadow: var(--shadow-card);
  }

  /* Mobile logo */
  .auth-card::before {
    content: '';
    display: block;
    /* Handled by .mobile-logo element */
  }

  #notification-container {
    top: auto;
    bottom: var(--space-5);
    right: var(--space-4);
    left: var(--space-4);
    max-width: 100%;
  }
}

@media (max-width: 400px) {
  .panel-right {
    padding: var(--space-5) var(--space-4);
  }
  .auth-card {
    padding: var(--space-6) var(--space-5);
    border-radius: var(--radius-lg);
  }

  .otp-group {
    gap: 5px;
  }

  .otp-digit {
    height: 46px;
    border-radius: var(--radius-sm);
    font-size: 1.0625rem;
  }
}

/* ─── Mobile top logo bar ───────────────────────────────────────────────────── */
.mobile-logo {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.mobile-logo__mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

.mobile-logo__mark svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.mobile-logo__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -.02em;
}

@media (max-width: 768px) {
  .mobile-logo { display: flex; }
}

/* ─── Accessibility ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-300); }

.success-description {
  font-size: 0.875rem;
  color: var(--gray-500);
  text-align: center;
  line-height: 1.65;
}

.success-description strong {
  color: var(--gray-800);
  font-weight: 600;
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-6);
  text-align: center;
}

/* ─── Notification / Toast ──────────────────────────────────────────────────── */
#notification-container {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 380px;
  width: calc(100vw - var(--space-10));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0,0,0,.05);
  transform: translateX(calc(100% + var(--space-5)));
  opacity: 0;
  transition: transform var(--t-spring), opacity var(--t-base);
  pointer-events: all;
}

.toast--visible {
  transform: translateX(0);
  opacity: 1;
}

.toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.toast__icon svg {
  width: 20px;
  height: 20px;
}

.toast--success .toast__icon { color: var(--color-success); }
.toast--error   .toast__icon { color: var(--color-error); }
.toast--warning .toast__icon { color: var(--color-warning); }
.toast--info    .toast__icon { color: var(--color-info); }

.toast--success { border-left: 3px solid var(--color-success); }
.toast--error   { border-left: 3px solid var(--color-error); }
.toast--warning { border-left: 3px solid var(--color-warning); }
.toast--info    { border-left: 3px solid var(--color-info); }

.toast__message {
  flex: 1;
  font-size: 0.875rem;
  color: var(--gray-700);
  line-height: 1.5;
}

.toast__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--gray-400);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--t-fast);
  padding: 0;
}

.toast__close:hover { color: var(--gray-700); }

.toast__close svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ─── Auth card footer ──────────────────────────────────────────────────────── */
.auth-card__footer {
  margin-top: var(--space-6);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--gray-500);
}

/* ─── Responsive – Tablet ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --left-width: 45%; }

  .hero__visual    { display: none; }
  .panel-left      { padding: var(--space-10) var(--space-8); }
  .hero__headline  { font-size: 1.875rem; }
}

/* ─── Responsive – Mobile ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .auth-root {
    grid-template-columns: 1fr;
    min-height: 100dvh;
  }

  .panel-left {
    display: none; /* Hidden on mobile – logo shown in header instead */
  }

  .panel-right {
    padding: var(--space-6) var(--space-5);
    background: var(--gray-50);
    align-items: flex-start;
    padding-top: var(--space-10);
  }

  .auth-card {
    max-width: 100%;
    background: #fff;
    border-radius: var(--radius-xl);
    padding: var(--space-8) var(--space-6);
    box-shadow: var(--shadow-card);
  }

  /* Mobile logo */
  .auth-card::before {
    content: '';
    display: block;
    /* Handled by .mobile-logo element */
  }

  #notification-container {
    top: auto;
    bottom: var(--space-5);
    right: var(--space-4);
    left: var(--space-4);
    max-width: 100%;
  }
}

@media (max-width: 400px) {
  .panel-right {
    padding: var(--space-5) var(--space-4);
  }
  .auth-card {
    padding: var(--space-6) var(--space-5);
    border-radius: var(--radius-lg);
  }

  .otp-group {
    gap: 5px;
  }

  .otp-digit {
    height: 46px;
    border-radius: var(--radius-sm);
    font-size: 1.0625rem;
  }
}

/* ─── Mobile top logo bar ───────────────────────────────────────────────────── */
.mobile-logo {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.mobile-logo__mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--blue-500), var(--blue-600));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

.mobile-logo__mark svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.mobile-logo__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -.02em;
}

@media (max-width: 768px) {
  .mobile-logo { display: flex; }
}

/* ─── Accessibility ─────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ─── Scrollbar ─────────────────────────────────────────────────────────────── */
