/* ===================================================
   JONOM — Login Page Styles
   =================================================== */

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

:root {
  --amber:       #F5A623;
  --amber-deep:  #E8951A;
  --amber-light: #FFF5E0;
  --navy:        #1B2A4A;
  --teal:        #2E7D7A;
  --teal-light:  #3BA39F;
  --text-dark:   #1A1A1A;
  --text-mid:    #444;
  --text-muted:  #888;
  --border:      #D8D8D8;
  --border-focus:#1B2A4A;
  --bg-pill:     #FFFFFF;
  --error:       #D32F2F;
  --success:     #2E7D32;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   28px;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.10);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: #ffffff;
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* vertical breathing room only — no horizontal padding so card can reach max-width */
  padding: 48px 0;
  margin: 0;
}

/* ===== OUTER CARD BORDER ===== */
.card-shell {
  /* Use calc to leave 40px gutter each side at any viewport width */
  width: calc(100vw - 80px);
  max-width: 1200px;
  /* horizontal auto-margin centres it when narrower than viewport */
  margin: 0 auto;
  border: 1.5px solid #C8CDD8;
  border-radius: 18px;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.06),
    0 10px 40px rgba(0,0,0,0.11),
    0 20px 60px rgba(0,0,0,0.07);
  overflow: hidden;
  background: #fff;
  min-height: 580px;
  display: flex;
  flex-direction: column;
}

/* ===== PAGE WRAPPER ===== */
.page-wrapper {
  display: flex;
  flex: 1;
  align-items: stretch;
  min-height: 580px;
}

/* ===== LEFT PANEL ===== */
.left-panel {
  width: 42%;
  min-width: 340px;
  background: linear-gradient(160deg, #FFF4D6 0%, #FDEBC0 45%, #F9DFA0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  gap: 28px;
}

/* Logo Card */
.logo-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 40px 22px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 320px;
}

.logo-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-inline .logo-img {
  height: 44px;
  width: auto;
  max-width: none;
}

.logo-brand {
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.logo-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.logo-box {
  border: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 12px 28px;
  position: relative;
}

.logo-box::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 6px;
  border-left: 3px solid var(--amber);
  border-right: 3px solid var(--amber);
  border-bottom: 3px solid var(--amber);
  border-radius: 0 0 4px 4px;
}

.logo-text {
  font-family: 'DM Serif Display', serif;
  font-size: 32px;
  color: var(--amber);
  letter-spacing: 2px;
}

.logo-sub {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--text-mid);
  font-weight: 500;
}

.logo-sub .dot {
  color: var(--amber);
  font-style: normal;
}

/* Tagline */
.tagline {
  text-align: center;
}

.tagline-bold {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.4;
}

.tagline-light {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-mid);
  margin-top: 3px;
}

/* Stat Strip */
.stat-strip {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: #D0B880;
  opacity: 0.6;
}

/* Pills */
.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 320px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-pill);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  white-space: nowrap;
}

/* ===== RIGHT PANEL ===== */
.right-panel {
  flex: 1;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 28px 48px 40px;
  position: relative;
}

/* Language Selector */
.lang-selector {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--text-mid);
  cursor: pointer;
  transition: border-color 0.2s;
  align-self: flex-end;
}

.lang-selector:hover {
  border-color: #aaa;
}

/* Form Container */
.form-container {
  width: 100%;
  max-width: 480px;
  margin-top: 32px;
  align-self: center;
}

/* Back Button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mid);
  padding: 6px 10px 6px 4px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
  margin-bottom: 20px;
}

.back-btn:hover {
  color: var(--text-dark);
  background: #f5f5f5;
}

/* Title */
.form-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 6px;
}

.form-subtitle {
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 28px;
}

.link-text {
  color: var(--teal);
  font-weight: 500;
}

/* ===== FIELD GROUP ===== */
.field-group {
  margin-bottom: 20px;
  position: relative;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mid);
  margin-bottom: 6px;
}

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

.field-input {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 14px;
  border: 1.6px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-size: 14.5px;
  color: var(--text-dark);
  background: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.field-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(27,42,74,0.08);
}

.field-input.is-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(211,47,47,0.08);
}

.field-input.is-valid {
  border-color: #43A047;
  box-shadow: 0 0 0 3px rgba(67,160,71,0.07);
}

/* Group-level error highlight box */
.field-group.has-error .input-wrap::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-md) + 2px);
  border: 2px solid rgba(211,47,47,0.18);
  pointer-events: none;
}

/* Eye Toggle */
.eye-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: color 0.2s;
}

.eye-btn:hover {
  color: var(--text-mid);
}

/* Field Error Text */
.field-error {
  display: block;
  font-size: 12px;
  color: var(--error);
  margin-top: 5px;
  min-height: 16px;
  font-weight: 500;
}

/* ===== PASSWORD STRENGTH ===== */
.strength-bar {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.strength-seg {
  height: 4px;
  flex: 1;
  background: #E8E8E8;
  border-radius: 4px;
  transition: background 0.3s;
}

.strength-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 4px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  min-height: 16px;
}

/* Strength levels */
.strength-bar[data-level="1"] .strength-seg:nth-child(1) { background: #E53935; }
.strength-bar[data-level="2"] .strength-seg:nth-child(-n+2) { background: #FB8C00; }
.strength-bar[data-level="3"] .strength-seg:nth-child(-n+3) { background: #FDD835; }
.strength-bar[data-level="4"] .strength-seg { background: #43A047; }

/* ===== RESPONSIVE ===== */
.btn-login {
  width: 100%;
  height: 50px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 26px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  letter-spacing: 0.3px;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 10px rgba(27,42,74,0.18);
  margin-bottom: 20px;
}

.btn-login:hover {
  background: #243660;
  box-shadow: 0 4px 16px rgba(27,42,74,0.26);
  transform: translateY(-1px);
}

.btn-login:active {
  transform: translateY(0);
}

.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.spinner-svg {
  animation: spin 0.8s linear infinite;
}

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

/* ===== SUCCESS STATE ===== */
.success-state {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #E8F5E9;
  border: 1px solid #A5D6A7;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--success);
  margin-bottom: 20px;
  animation: fadeSlideIn 0.4s ease;
}

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

/* ===== OR DIVIDER ===== */
.or-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.or-line {
  flex: 1;
  height: 1px;
  background: #E0E0E0;
}

.or-text {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}

/* ===== GOOGLE BUTTON ===== */
.btn-google {
  width: 100%;
  height: 48px;
  background: #fff;
  border: 1.6px solid var(--border);
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  margin-bottom: 24px;
}

.btn-google:hover {
  border-color: #aaa;
  background: #fafafa;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 820px) {
  body {
    padding: 20px 0;
    align-items: flex-start;
  }

  .card-shell {
    width: calc(100vw - 24px);
    border-radius: 14px;
    min-height: unset;
  }

  .page-wrapper {
    flex-direction: column;
    min-height: unset;
  }

  .left-panel {
    width: 100%;
    min-width: unset;
    padding: 40px 24px;
  }

  .right-panel {
    padding: 28px 24px 48px;
    align-items: center;
  }

  .lang-selector {
    align-self: flex-end;
  }

  .form-container {
    margin-top: 20px;
  }
}

@media (max-width: 480px) {
  .form-title {
    font-size: 24px;
  }

  .right-panel {
    padding: 20px 16px 40px;
  }

  .pill-grid {
    gap: 8px;
  }
}
