/* ==========================================================================
   Authentication — SoneyaDrive Guinea theme
   Full-viewport split layout: image panel | form panel
   ========================================================================== */

/* ── Override global layout for auth pages ───────────────────────────────── */
body.auth-page {
  background: var(--gn-dark);
  min-height: 100vh;
}

body.auth-page .main-layout {
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, var(--gn-dark) 0%, #1a4a2e 55%, #1f5c38 100%);
}

body.auth-page .content-wrapper {
  padding: 0 !important;
  animation: none !important;
  flex: 1;
  display: flex;
  min-height: 100vh;
}

/* ── Two-column full-viewport container ─────────────────────────────────── */
.auth-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  min-height: 100vh;
}

/* Register: form is first in DOM (left), image second (right) — default order works */
/* Login: image first in DOM (left), form second (right) — default order works */

/* ── Image panel ─────────────────────────────────────────────────────────── */
.auth-image {
  position: relative;
  overflow: hidden;
  background: var(--gn-dark);
}

.auth-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Gradient overlay */
.auth-image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(13, 46, 26, .92) 0%,
    rgba(13, 46, 26, .75) 45%,
    rgba(13, 46, 26, .55) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 56px 52px;
  color: #fff;
  z-index: 1;
}

.auth-image-overlay h2 {
  margin: 0 0 12px;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  font-family: 'Questrial', sans-serif;
}

.auth-image-overlay > p {
  margin: 0 0 32px;
  color: rgba(255, 255, 255, .82);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 380px;
}

/* Feature list */
.auth-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 36px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, .9);
}

.feature-item i {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(245, 166, 35, .18);
  border: 1px solid rgba(245, 166, 35, .3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gn-gold);
  font-size: .82rem;
  flex-shrink: 0;
}

/* Stats row */
.auth-stats {
  display: flex;
  gap: 28px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, .16);
}

.auth-stats .stat-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.auth-stats .stat-item strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gn-gold);
  line-height: 1;
}

.auth-stats .stat-item span {
  font-size: .75rem;
  color: rgba(255, 255, 255, .65);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Form panel ──────────────────────────────────────────────────────────── */
.auth-form-section {
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 60px 32px;
}

.auth-form-container {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 24px;
  padding: 44px 40px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .28), 0 4px 16px rgba(0, 0, 0, .12);
}

/* ── Auth header ─────────────────────────────────────────────────────────── */
.auth-header {
  text-align: center;
  margin-bottom: 36px;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--gn-dark);
  margin-bottom: 24px;
  text-decoration: none;
}

.auth-logo i {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(26, 143, 92, .1);
  border: 1.5px solid rgba(26, 143, 92, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gn-green);
  font-size: 1.15rem;
}

.auth-header h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gn-dark);
}

.auth-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: .95rem;
}

/* ── Form ────────────────────────────────────────────────────────────────── */
.auth-form {
  display: grid;
  gap: 16px;
}

.form-group {
  display: grid;
  gap: 6px;
}

.form-group label {
  font-weight: 600;
  font-size: .875rem;
  color: var(--gn-dark);
}

.label-required::after {
  content: ' *';
  color: #CE1126;
}

/* ── Input wrapper ───────────────────────────────────────────────────────── */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper > i {
  position: absolute;
  left: 16px;
  color: rgba(13, 46, 26, .38);
  font-size: .88rem;
  pointer-events: none;
  z-index: 1;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="tel"],
.auth-form select {
  width: 100%;
  border: 1.5px solid #dde8e2;
  border-radius: 50px;
  padding: 11px 44px 11px 44px;
  font-size: .95rem;
  background: #f8fcfa;
  color: var(--gn-dark);
  transition: border-color .2s, box-shadow .2s, background .2s;
  outline: none;
  font-family: inherit;
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: var(--gn-green);
  box-shadow: 0 0 0 3px rgba(26, 143, 92, .12);
  background: #fff;
}

.auth-form input.is-valid  { border-color: var(--gn-green); }
.auth-form input.is-invalid { border-color: #CE1126; box-shadow: 0 0 0 3px rgba(206,17,38,.08); }

/* Toggle password */
.toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(13, 46, 26, .4);
  padding: 4px 6px;
  display: flex;
  align-items: center;
  transition: color .2s;
  font-size: .88rem;
}

.toggle-password:hover { color: var(--gn-green); }

/* ── Helpers ─────────────────────────────────────────────────────────────── */
.form-help {
  font-size: .78rem;
  color: var(--text-muted);
}

.form-error {
  font-size: .8rem;
  color: #CE1126;
  font-weight: 500;
}

/* ── Form row (two columns) ──────────────────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Form options ────────────────────────────────────────────────────────── */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .875rem;
}

/* Custom checkbox */
.checkbox-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  color: var(--gn-dark);
  user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #ccd8d0;
  border-radius: 5px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color .2s, background .2s;
}

.checkbox-wrapper input:checked ~ .checkmark {
  background: var(--gn-green);
  border-color: var(--gn-green);
}

.checkbox-wrapper input:checked ~ .checkmark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}

.forgot-link {
  color: var(--gn-green);
  font-weight: 600;
  text-decoration: none;
  font-size: .875rem;
  transition: color .2s;
}

.forgot-link:hover { color: var(--gn-green-dark, #136B44); text-decoration: underline; }

/* ── Role cards ──────────────────────────────────────────────────────────── */
.role-selection {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.role-option { cursor: pointer; }

.role-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.role-card {
  border: 2px solid #dde8e2;
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  transition: border-color .2s, background .2s, box-shadow .2s;
  background: #f8fcfa;
}

.role-card i { font-size: 1.5rem; color: var(--gn-green); margin-bottom: 6px; display: block; }
.role-card h3 { margin: 0 0 4px; font-size: .875rem; font-weight: 700; color: var(--gn-dark); }
.role-card p  { margin: 0; font-size: .75rem; color: var(--text-muted); line-height: 1.4; }

.role-option input:checked ~ .role-card {
  border-color: var(--gn-green);
  background: rgba(26,143,92,.06);
  box-shadow: 0 0 0 3px rgba(26,143,92,.1);
}

.role-option:hover .role-card { border-color: rgba(26,143,92,.4); }

/* ── Divider ─────────────────────────────────────────────────────────────── */
.auth-divider {
  position: relative;
  text-align: center;
  margin: 6px 0;
}

.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: #e4ede8;
}

.auth-divider span {
  position: relative;
  background: #fff;
  padding: 0 14px;
  font-size: .82rem;
  color: var(--text-muted);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  display: grid;
  gap: 12px;
}

.auth-footer p { margin: 0; font-size: .875rem; color: var(--text-muted); }
.auth-footer a { color: var(--gn-green); font-weight: 600; text-decoration: none; }

/* ── btn-outline ─────────────────────────────────────────────────────────── */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 2px solid var(--gn-green);
  border-radius: 50px;
  background: transparent;
  color: var(--gn-green);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s, color .2s;
}

.btn-outline:hover { background: var(--gn-green); color: #fff; text-decoration: none; }
.btn-full { width: 100%; }

/* ── Back button ─────────────────────────────────────────────────────────── */
.auth-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 28px;
  padding: 6px 0;
  transition: color .2s, gap .2s;
}

.auth-back-btn i {
  font-size: .8rem;
  transition: transform .2s;
}

.auth-back-btn:hover {
  color: var(--gn-green);
  gap: 12px;
  text-decoration: none;
}

.auth-back-btn:hover i { transform: translateX(-3px); }

/* ── Single-panel variant (forgot-password) ──────────────────────────────── */
.auth-container--single {
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.auth-container--single .auth-form-section {
  justify-content: center;
  align-items: center;
}

.auth-container--single .auth-form-container {
  max-width: 460px;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 920px) {
  .auth-container { grid-template-columns: 1fr; }
  .auth-image { display: none; }
  .auth-form-section { padding: 40px 20px; justify-content: flex-start; padding-top: 48px; }
  .auth-form-container { padding: 36px 28px; border-radius: 20px; }
}

@media (max-width: 480px) {
  .auth-form-section { padding: 24px 14px; }
  .auth-form-container { padding: 28px 20px; border-radius: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .role-selection { grid-template-columns: 1fr; }
  .auth-header h1 { font-size: 1.5rem; }
}

@media (max-width: 360px) {
  .auth-form-container { padding: 22px 16px; }
  .auth-header h1 { font-size: 1.25rem; }
  .auth-header p  { font-size: .85rem; }
}
