/* ============================================================
   LOGIN / REGISTER
   Split screen: navy brand panel + light form panel.
   ============================================================ */

.auth-page {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background: var(--white);
}

/* ── Brand panel ────────────────────────────────────────────── */
.auth-left {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 44%;
  padding: clamp(2.5rem, 5vw, 4.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--ink-body);
  background:
    radial-gradient(34rem 26rem at 100% 0%, rgba(201, 164, 76, 0.24), transparent 62%),
    radial-gradient(30rem 24rem at 0% 100%, rgba(31, 67, 130, 0.65), transparent 66%),
    linear-gradient(165deg, var(--navy-dark), var(--navy));
}

.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 47px, rgba(255, 255, 255, 0.05) 47px, rgba(255, 255, 255, 0.05) 48px);
}

/* closing double rule */
.auth-left::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 5px;
  border-left: 1px solid rgba(201, 164, 76, 0.7);
  border-right: 1px solid rgba(201, 164, 76, 0.7);
}

.auth-left-content { position: relative; z-index: 2; max-width: 30rem; }

.auth-logo {
  display: inline-flex;
  align-items: center;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  padding: 0.85rem 1.35rem;
  background: #FFFFFF;
  border-radius: 18px;
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.7);
  color: var(--navy);
  text-decoration: none;
}

.auth-logo-icon { font-size: 3rem; }
.auth-logo-text { display: flex; flex-direction: column; }
.auth-logo-name { font-size: 1.8rem; font-weight: 700; letter-spacing: 0.5px; }
.auth-logo-sub  { font-size: 0.9rem; opacity: 0.8; }

.auth-tagline {
  font-size: clamp(1.9rem, 1.3rem + 2vw, 2.7rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #FFFFFF;
  margin-bottom: 2rem;
}

.auth-features { margin: 0; padding: 0; }

.auth-features li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.86);
}

.auth-features li::before {
  content: '✓';
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(201, 164, 76, 0.16);
  border: 1px solid rgba(201, 164, 76, 0.55);
  color: var(--gold-light);
  font-size: 0.8rem;
  font-weight: 700;
}

/* ── Form panel ─────────────────────────────────────────────── */
.auth-right {
  width: 56%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  max-height: 100vh;
  max-height: 100dvh;
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1.25rem, 3vw, 2.5rem);
  background: var(--white);
}

.auth-form-wrapper {
  width: 100%;
  max-width: 440px;
  margin: auto 0;
}

.auth-form-wrapper.wide { max-width: 560px; }

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  color: var(--gray-600);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color var(--transition-fast), translate var(--transition);
}

.auth-back:hover { color: var(--navy); translate: -3px 0; }

.auth-header { margin-bottom: 2rem; }

.auth-title {
  font-size: clamp(1.8rem, 1.5rem + 1vw, 2.3rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.auth-subtitle { color: var(--gray-600); line-height: 1.6; }

.auth-form { display: flex; flex-direction: column; gap: 0.25rem; }

/* user type selection cards */
.user-type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.15rem;
}

.user-type-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  color: var(--gray-700);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.user-type-card input[type="radio"] {
  flex: none;
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
  cursor: pointer;
}

.user-type-card:hover { border-color: var(--gray-400); background: var(--white); }

.user-type-card.active {
  background: #FCF8EC;
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px var(--accent-glow);
  color: var(--navy);
  font-weight: 600;
}

/* branches (professional accounts) */
.branches-container {
  padding: 1.25rem;
  margin-top: 0.25rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  display: none;
}

.branches-header { margin-bottom: 1rem; gap: 1rem; }
.branches-title { font-size: 1rem; font-weight: 600; color: var(--navy); }

.branch-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem;
  margin-bottom: 0.85rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.branch-card:last-child { margin-bottom: 0; }

.branch-card-header { display: flex; justify-content: space-between; align-items: center; }

.branch-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
}

.btn-remove-branch {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  color: var(--danger-ink);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.btn-remove-branch:hover { background: var(--danger-bg); }

/* password */
.password-wrapper { position: relative; }
.password-wrapper .form-input { padding-right: 3rem; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  width: 40px;
  height: 40px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--gray-500);
  font-size: 1.15rem;
  transition: background-color var(--transition-fast);
}

.password-toggle:hover { background: var(--gray-100); }

.password-strength {
  height: 5px;
  margin-top: 0.55rem;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}

.password-strength-bar {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-weak   { width: 33%;  background-color: var(--danger); }
.strength-medium { width: 66%;  background-color: var(--warning); }
.strength-strong { width: 100%; background-color: var(--success); }

.auth-btn { margin-top: 0.75rem; }

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.75rem 0;
  color: var(--gray-500);
  font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--gray-200);
}

.auth-divider::before { margin-right: 0.9em; }
.auth-divider::after  { margin-left: 0.9em; }

.auth-toggle { text-align: center; color: var(--gray-600); }

.auth-toggle a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.auth-toggle a:hover { text-decoration-color: var(--gold-dark); }

.auth-error-box {
  display: none;
  margin-bottom: 1.25rem;
  padding: 0.95rem 1.1rem;
  background: var(--danger-bg);
  border: 1px solid rgba(214, 56, 43, 0.3);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  color: var(--danger-ink);
  font-size: 0.93rem;
  line-height: 1.5;
}

.demo-hint {
  margin-top: 2rem;
  padding: 1rem 1.1rem;
  background: var(--gray-50);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius);
  color: var(--gray-700);
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.demo-hint strong { color: var(--navy); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-page { flex-direction: column; }

  /* brand panel becomes a compact banner */
  .auth-left {
    width: 100%;
    padding: 1.5rem 1.25rem 1.75rem;
  }

  .auth-left::after { top: auto; left: 0; width: auto; height: 5px; border: 0; border-top: 1px solid rgba(201, 164, 76, 0.7); border-bottom: 1px solid rgba(201, 164, 76, 0.7); }

  .auth-logo { margin-bottom: 1.25rem; padding: 0.6rem 1rem; }
  .auth-tagline { font-size: 1.55rem; margin-bottom: 0; }
  .auth-features { display: none; }

  .auth-right {
    width: 100%;
    max-height: none;
    overflow-y: visible;
    padding: 2rem 1.25rem 2.5rem;
  }
}

@media (max-width: 560px) {
  .user-type-selector { grid-template-columns: 1fr; }
}
