/* ============================================================
   MERIK AUTH PAGES — signin.php, signup.php, verify.php etc.
   ============================================================ */



:root {
  --primary:      #00bcd4;
  --primary-dark: #0097a7;
  --primary-glow: rgba(0,188,212,0.2);
  --navy:         #0d1b2a;
  --navy-light:   #162032;
  --surface:      #ffffff;
  --border:       #e5e7eb;
  --text:         #1a1a2e;
  --text-muted:   #6b7280;
  --radius:       12px;
  --transition:   0.3s ease;
  --font-display: 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Segoe UI', system-ui, sans-serif;
}

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

.auth-body {
  font-family: var(--font-body);
  background: var(--navy);
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  -webkit-font-smoothing: antialiased;
}

/* ── Two-panel layout ─────────────────────────────────────── */
.auth-page {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* LEFT — branded panel */
.auth-panel-left {
  flex: 0 0 420px;
  background: linear-gradient(160deg, var(--navy) 0%, #0a2540 60%, rgba(0,188,212,0.15) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 44px;
  border-right: 1px solid rgba(255,255,255,0.07);
  position: relative;
  overflow: hidden;
}

/* Subtle background glow */
.auth-panel-left::before {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(0,188,212,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.auth-panel-inner {
  position: relative;
  z-index: 1;
  color: #fff;
}

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

.auth-logo img {
  height: 44px;
  border-radius: 8px;
}

.auth-logo span {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.auth-panel-inner h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  color: #fff;
}

.auth-panel-inner > p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.65;
  margin-bottom: 36px;
}

.auth-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
}

.auth-feat {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.92rem;
  color: rgba(255,255,255,0.82);
}

.auth-feat i {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(0,188,212,0.15);
  border: 1px solid rgba(0,188,212,0.25);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.auth-panel-note {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.5);
}

.auth-panel-note a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-panel-note a:hover { text-decoration: underline; }

/* RIGHT — form panel */
.auth-panel-right {
  flex: 1;
  background: #f4f6f9;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
}

.auth-form-box {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
}

.auth-form-box-wide { max-width: 560px; }

/* Form header */
.auth-form-header {
  margin-bottom: 28px;
}

.auth-form-header h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-form-header p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-form-header p a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-form-header p a:hover { text-decoration: underline; }

/* Alerts */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.auth-alert i { margin-top: 2px; flex-shrink: 0; }
.auth-alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.auth-alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.auth-alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.auth-alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.auth-alert a.resend-link { color: inherit; font-weight: 700; text-decoration: underline; }

/* Fields */
.auth-field {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.req { color: #ef4444; }

.auth-field-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auth-forgot {
  font-size: 0.82rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.auth-forgot:hover { text-decoration: underline; }

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

.auth-input-wrap > i:first-child {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 0.88rem;
  z-index: 1;
  pointer-events: none;
}

.auth-input-wrap input {
  width: 100%;
  padding: 12px 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.93rem;
  color: var(--text);
  background: #f9fafb;
  outline: none;
  transition: all var(--transition);
}

.auth-input-wrap input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.has-error .auth-input-wrap input { border-color: #ef4444; }
.has-error .auth-input-wrap input:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }

.field-error {
  font-size: 0.82rem;
  color: #ef4444;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Toggle password button */
.toggle-pw {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  font-size: 0.9rem;
  transition: color var(--transition);
  z-index: 1;
}
.toggle-pw:hover { color: var(--primary); }

/* Two-column row */
.auth-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Phone wrap */
.auth-phone-wrap {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.auth-country-select {
  flex: 0 0 auto;
  max-width: 180px;
  padding: 11px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: #f9fafb;
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: all var(--transition);
}

.auth-country-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Password strength bar */
.pw-strength-bar {
  height: 3px;
  background: var(--border);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}

.pw-strength-bar > div {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width 0.4s ease, background 0.4s ease;
}

/* Submit button */
.auth-submit {
  width: 100%;
  justify-content: center;
  padding: 14px;
  font-size: 1rem;
  border-radius: var(--radius);
  gap: 10px;
  margin-top: 4px;
  transition: all var(--transition);
}

.auth-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--text-muted);
  font-size: 0.82rem;
}

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

/* Google button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 0.93rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.btn-google:hover {
  border-color: #4285f4;
  background: #f8f9fe;
  box-shadow: 0 2px 12px rgba(66,133,244,0.15);
}

.btn-google img { width: 20px; height: 20px; }

/* Back link */
.auth-back {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
}

.auth-back a {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition);
}

.auth-back a:hover { color: var(--primary); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-panel-left { display: none; }
  .auth-panel-right { background: var(--navy); padding: 24px 16px; }
  .auth-form-box { max-width: 100%; border-radius: 16px; padding: 32px 24px; }
  .auth-form-box-wide { max-width: 100%; }
}

@media (max-width: 540px) {
  .auth-row { grid-template-columns: 1fr; }
  .auth-phone-wrap { flex-direction: column; }
  .auth-country-select { max-width: 100%; }
  .auth-form-box { padding: 28px 20px; }
}

/* ============================================================
   CENTERED CARD LAYOUT (verify, forgot, reset pages)
   ============================================================ */
.auth-centered {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: var(--navy);
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 20px;
  padding: 44px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}

.auth-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(0,188,212,0.1);
  border: 1px solid rgba(0,188,212,0.25);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 20px;
}

.auth-card h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.auth-card-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.auth-card .auth-field { text-align: left; }

/* ── OTP Digit Inputs ───────────────────────────────────── */
.otp-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 8px 0;
}

.otp-digit {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  font-family: var(--font-display);
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #f9fafb;
  color: var(--text);
  outline: none;
  transition: all var(--transition);
  caret-color: var(--primary);
}

.otp-digit:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-glow);
  transform: translateY(-2px);
}

.otp-digit:not(:placeholder-shown) {
  border-color: var(--primary);
  background: rgba(0,188,212,0.05);
}

/* ── Password Checklist ─────────────────────────────────── */
.pw-checklist {
  list-style: none;
  padding: 10px 0 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pw-checklist li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.pw-checklist li i {
  width: 14px;
  text-align: center;
  font-size: 0.75rem;
  color: #ef4444;
  transition: color var(--transition);
}

.pw-checklist li.ok { color: #10b981; }
.pw-checklist li.ok i { color: #10b981; }

/* ── Field messages ─────────────────────────────────────── */
.field-msg {
  font-size: 0.83rem;
  margin-top: 6px;
  display: block;
}
.field-msg.ok  { color: #10b981; }
.field-msg.err { color: #ef4444; }

/* ── Resend section ─────────────────────────────────────── */
.auth-resend {
  margin-top: 24px;
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.auth-resend p { margin: 0; }

.btn-text-link {
  background: none;
  border: none;
  color: var(--primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  transition: color var(--transition);
}
.btn-text-link:hover { color: var(--primary-dark); text-decoration: underline; }
.btn-text-link:disabled { opacity: 0.4; cursor: not-allowed; }

.resend-msg { font-size: 0.85rem; }
.resend-msg.ok  { color: #10b981; }
.resend-msg.err { color: #ef4444; }

.resend-countdown {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 520px) {
  .auth-card { padding: 32px 20px; }
  .otp-digit { width: 36px; height: 44px; font-size: 1.1rem; }
  .otp-inputs { gap: 5px; }
}
