/**
 * IWC Auth Pages — Unified Stylesheet
 * Premium design: navy + gold, Poppins typography, smooth animations
 */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
  --navy:        #0a1f33;
  --navy-light:  #0d2640;
  --navy-mid:    #122d4a;
  --gold:        #D4AF37;
  --gold-light:  #e8c84a;
  --gold-dark:   #b8961f;
  --white:       #ffffff;
  --off-white:   #f7f8fa;
  --text-muted:  #8a9bb0;
  --border:      rgba(212,175,55,0.2);
  --success:     #28a745;
  --error:       #dc3545;
  --warning:     #ffc107;
  --shadow-lg:   0 20px 60px rgba(0,0,0,0.4);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.3);
  --radius:      16px;
  --radius-sm:   10px;
  --transition:  all 0.3s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Auth Layout ── */
.auth-wrapper {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
}

/* ── Left Panel (Branding) ── */
.auth-left {
  background: linear-gradient(145deg, var(--navy) 0%, var(--navy-mid) 50%, #0f2e4f 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 50px;
  position: relative;
  overflow: hidden;
}

/* Gold grid pattern background */
.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(212,175,55,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,175,55,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* Glowing orb */
.auth-left::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(212,175,55,0.12) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.auth-branding {
  position: relative;
  z-index: 1;
  text-align: center;
  animation: fadeInUp 0.8s ease both;
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 48px;
  text-decoration: none;
}

.auth-logo-mark {
  width: 56px;
  height: 56px;
  background: var(--gold);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -1px;
  box-shadow: 0 4px 20px rgba(212,175,55,0.4);
  flex-shrink: 0;
}

.auth-logo-text {
  text-align: left;
}

.auth-logo-text .name {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.auth-logo-text .tagline {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.auth-headline {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 20px;
  color: var(--white);
}

.auth-headline span {
  color: var(--gold);
  display: block;
}

.auth-subtext {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 380px;
  margin: 0 auto 48px;
}

/* Stats row */
.auth-stats {
  display: flex;
  gap: 40px;
  justify-content: center;
  margin-top: 48px;
}

.auth-stat {
  text-align: center;
}

.auth-stat .number {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

.auth-stat .label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
}

/* Flags */
.auth-flags {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
}

.auth-flag {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  transition: var(--transition);
}

.auth-flag:hover {
  background: rgba(212,175,55,0.15);
  border-color: var(--gold);
  transform: translateY(-2px);
}

/* Testimonial */
.auth-testimonial {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  margin-top: 40px;
  text-align: left;
  max-width: 380px;
}

.auth-testimonial blockquote {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  font-style: italic;
  margin-bottom: 12px;
}

.auth-testimonial cite {
  font-size: 12px;
  color: var(--gold);
  font-style: normal;
  font-weight: 600;
}

/* ── Right Panel (Form) ── */
.auth-right {
  background: var(--navy-light);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 30px;
  position: relative;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  animation: fadeInRight 0.7s ease both;
  animation-delay: 0.1s;
}

.auth-card-header {
  margin-bottom: 36px;
}

.auth-card-header h1 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
  line-height: 1.2;
}

.auth-card-header p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.auth-card-header p a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.auth-card-header p a:hover { color: var(--gold-light); }

/* ── Form Elements ── */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #c8d8e8;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.form-label .required {
  color: var(--gold);
  margin-left: 3px;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
  transition: color 0.2s;
  z-index: 1;
}

.form-control {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 14px 16px 14px 46px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  color: var(--white);
  transition: var(--transition);
  outline: none;
  height: 52px;
}

.form-control::placeholder { color: #4a6080; }

.form-control:focus {
  border-color: var(--gold);
  background: rgba(212,175,55,0.06);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.12);
}

.form-control:focus ~ .input-icon,
.input-wrapper:focus-within .input-icon {
  color: var(--gold);
}

.form-control.is-invalid {
  border-color: var(--error);
  background: rgba(220,53,69,0.06);
}

.form-control.is-valid {
  border-color: var(--success);
  background: rgba(40,167,69,0.06);
}

/* No left icon variant */
.form-control.no-icon { padding-left: 16px; }

/* Password toggle */
.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 15px;
  transition: color 0.2s;
  z-index: 2;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Inline validation messages */
.field-error {
  display: none;
  font-size: 12px;
  color: var(--error);
  margin-top: 6px;
  padding-left: 4px;
  animation: slideDown 0.2s ease;
}

.field-success {
  display: none;
  font-size: 12px;
  color: var(--success);
  margin-top: 6px;
  padding-left: 4px;
}

.form-group.has-error .field-error { display: block; }
.form-group.has-success .field-success { display: block; }

/* Select dropdown */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a9bb0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}

.form-select option {
  background: var(--navy-mid);
  color: var(--white);
}

/* Checkbox */
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.form-check-input {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  transition: var(--transition);
  position: relative;
}

.form-check-input:checked {
  background: var(--gold);
  border-color: var(--gold);
}

.form-check-input:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: 2px solid var(--navy);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.form-check-label {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-check-label a {
  color: var(--gold);
  text-decoration: none;
}

/* ── Password Strength ── */
.password-strength {
  margin-top: 10px;
}

.strength-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.4s ease, background-color 0.3s ease;
}

.strength-fill.weak   { width: 25%; background: var(--error); }
.strength-fill.fair   { width: 50%; background: var(--warning); }
.strength-fill.good   { width: 75%; background: #17a2b8; }
.strength-fill.strong { width: 100%; background: var(--success); }

.strength-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Buttons ── */
.btn-primary-gold {
  width: 100%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  padding: 15px 24px;
  font-size: 15px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.3px;
  margin-top: 8px;
}

.btn-primary-gold::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-primary-gold:hover::before { opacity: 1; }
.btn-primary-gold:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(212,175,55,0.35); }
.btn-primary-gold:active { transform: translateY(0); }

.btn-primary-gold span { position: relative; z-index: 1; }

.btn-primary-gold.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(10,31,51,0.3);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.btn-link {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.btn-link:hover { color: var(--gold-light); }

/* ── Alert Banners ── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.5;
  animation: slideDown 0.3s ease;
}

.alert i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.alert-error {
  background: rgba(220,53,69,0.12);
  border: 1px solid rgba(220,53,69,0.3);
  color: #f8a5ae;
}

.alert-success {
  background: rgba(40,167,69,0.12);
  border: 1px solid rgba(40,167,69,0.3);
  color: #7dd3a2;
}

.alert-info {
  background: rgba(212,175,55,0.1);
  border: 1px solid var(--border);
  color: var(--gold);
}

.alert-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
  font-size: 16px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.alert-close:hover { opacity: 1; }

/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

/* ── Step Progress (Multi-step) ── */
.step-progress {
  display: flex;
  align-items: center;
  margin-bottom: 36px;
  gap: 0;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: rgba(255,255,255,0.08);
  z-index: 0;
}

.step-item.completed::after {
  background: var(--gold);
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.1);
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  transition: var(--transition);
}

.step-item.active .step-dot {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--navy);
  box-shadow: 0 0 0 4px rgba(212,175,55,0.2);
}

.step-item.completed .step-dot {
  background: rgba(212,175,55,0.2);
  border-color: var(--gold);
  color: var(--gold);
}

.step-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.step-item.active .step-label { color: var(--gold); font-weight: 600; }

/* ── Back to Site Link ── */
.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 32px;
  transition: color 0.2s;
}

.auth-back-link:hover { color: var(--gold); }

/* ── Mobile ── */
@media (max-width: 900px) {
  .auth-wrapper { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { min-height: 100vh; padding: 30px 20px; }
  .auth-card { max-width: 100%; }

  /* Show mini logo on mobile */
  .auth-mobile-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
  }
}

@media (min-width: 901px) {
  .auth-mobile-header { display: none; }
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(212,175,55,0); }
}

/* ── Misc ── */
.text-gold  { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-sm    { font-size: 13px; }
.mt-2       { margin-top: 8px; }
.mt-3       { margin-top: 12px; }
.d-flex     { display: flex; }
.justify-between { justify-content: space-between; }
.align-center    { align-items: center; }
.gap-2      { gap: 8px; }
.w-full     { width: 100%; }
.text-center { text-align: center; }
.mb-0       { margin-bottom: 0; }

/* ── OTP Input ── */
.otp-inputs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 20px 0;
}

.otp-input {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--white);
  outline: none;
  transition: var(--transition);
  font-family: 'Poppins', sans-serif;
  caret-color: var(--gold);
}

.otp-input:focus {
  border-color: var(--gold);
  background: rgba(212,175,55,0.06);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.12);
}

/* ── Success State ── */
.success-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(40,167,69,0.15);
  border: 2px solid rgba(40,167,69,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 36px;
  animation: pulse-gold 2s ease infinite;
}

/* ── HQ Admin Login Specific ── */
.hq-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212,175,55,0.12);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

/* ── Footer ── */
.auth-footer {
  text-align: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.auth-footer a:hover { color: var(--gold); }

/* ── Input Row (2-col) ── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}
