/* ─────────────────────────────────────────────
   SIPC / Winz Login – auth/css/login.css
   Clean, professional, Facebook-blue palette
───────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Lato:wght@300;400;700&display=swap');

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

:root {
  --blue-dark:   #2d4373;
  --blue-main:   #3b5998;
  --blue-light:  #4f6faf;
  --blue-hover:  #354f8a;
  --accent:      #6c8ebf;
  --red:         #e74c3c;
  --green:       #27ae60;
  --bg:          #dde3ec;
  --card:        #ffffff;
  --border:      #c8d3e6;
  --text:        #1a2340;
  --muted:       #7a8db0;
  --input-bg:    #f4f6fb;
  --shadow:      0 8px 40px rgba(59,89,152,.18);
  --radius:      10px;
  --transition:  .22s ease;
}

html, body {
  height: 100%;
  font-family: 'Lato', sans-serif;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(59,89,152,.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(77,110,175,.10) 0%, transparent 55%);
}

/* ── Card — wider ── */
.login-card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 400px;
  min-width: 400px;
  padding: 36px 32px 32px;
  position: relative;
  overflow: hidden;
  animation: slideUp .45s cubic-bezier(.22,.68,0,1.2) both;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue-dark), var(--blue-light));
}

/* ── Logo ── */
.brand {
  text-align: center;
  margin-bottom: 22px;
}
.brand img {
  max-width: 200px;
  height: auto;
}
.brand-fallback {
  font-family: 'Nunito', sans-serif;
  font-size: 34px;
  font-weight: 800;
  color: var(--blue-main);
  letter-spacing: -1px;
}
.divider { border: none; border-top: 1px solid var(--border); margin: 0 0 24px; }

/* ── Heading ── */
.panel-title {
  font-family: 'Nunito', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--blue-dark);
  text-align: center;
  margin-bottom: 28px;
  letter-spacing: .3px;
}

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

/* Left icon (user/badge/lock etc.) */
.form-group .icon-left {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
  z-index: 1;
}

/* Right toggle eye button */
.toggle-pwd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  transition: color var(--transition);
  z-index: 2;
}
.toggle-pwd:hover { color: var(--blue-main); }

/* Static right icon (no toggle) */
.form-group .icon-right {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events: none;
}

/* Input with icons on both sides */
.form-control {
  width: 100%;
  padding: 12px 44px 12px 40px; /* left pad for icon, right pad for eye */
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  font-family: 'Lato', sans-serif;
  font-size: 15px;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  height: 48px;
}
/* Input without left icon */
.form-control.no-left-icon {
  padding-left: 14px;
}
.form-control::placeholder { color: #b0bcd0; }
.form-control:focus {
  border-color: var(--blue-main);
  box-shadow: 0 0 0 3px rgba(59,89,152,.14);
  background: #fff;
}
.form-control.is-invalid { border-color: var(--red); }
.form-control.is-valid   { border-color: var(--green); }

/* ── Step 2 fields hidden by default ── */
#step2-fields { display: none; }
#step2-fields.show { display: block; animation: fadeIn .3s ease; }

/* ── Error messages ── */
.field-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 5px;
  display: none;
}
.field-error.show { display: block; }

/* ── Alert box ── */
.alert {
  border-radius: 8px;
  padding: 11px 16px;
  font-size: 13.5px;
  margin-bottom: 18px;
  display: none;
}
.alert.show { display: flex; align-items: center; gap: 8px; }
.alert-danger  { background: #fdf0ef; color: #c0392b; border: 1px solid #f5c6cb; }
.alert-success { background: #edfaf1; color: #1e7e34; border: 1px solid #b8dfc5; }
.alert-info    { background: #eaf0fb; color: var(--blue-dark); border: 1px solid #b8cff5; }
.alert-warning { background: #fffbec; color: #856404; border: 1px solid #ffe69c; }

/* ── Step indicator ── */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}
.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  border: 2px solid var(--border);
  color: var(--muted);
  transition: all .25s;
}
.step-dot.active { border-color: var(--blue-main); background: var(--blue-main); color: #fff; }
.step-dot.done   { border-color: var(--green); background: var(--green); color: #fff; }
.step-line { flex: 1; height: 2px; background: var(--border); transition: background .25s; max-width: 160px; }
.step-line.done { background: var(--green); }

/* ── Buttons ── */
.btn-signin {
  width: 100%;
  padding: 13px;
  background: var(--blue-main);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform .1s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 6px;
}
.btn-signin:hover  { background: var(--blue-hover); }
.btn-signin:active { transform: scale(.98); }
.btn-signin:disabled { opacity: .65; cursor: not-allowed; }

.btn-back {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  padding: 8px 18px;
  cursor: pointer;
  transition: all .2s;
  height: 46px;
}
.btn-back:hover { border-color: var(--blue-main); color: var(--blue-main); }

/* ── Row actions ── */
.row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 10px;
}
.link-forgot {
  font-size: 13px;
  color: var(--blue-main);
  text-decoration: none;
  cursor: pointer;
  background: none; border: none;
  font-family: 'Lato', sans-serif;
}
.link-forgot:hover { text-decoration: underline; }

/* ── Spinner ── */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn-signin.loading .spinner  { display: inline-block; }
.btn-signin.loading .btn-text { display: none; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30,40,70,.45);
  backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  width: 400px;
  padding: 34px 30px 26px;
  animation: slideUp .3s ease;
}
.modal-box h3 { font-family: 'Nunito', sans-serif; color: var(--blue-dark); margin-bottom: 20px; font-size: 19px; }
.modal-close {
  float: right; background: none; border: none;
  font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1;
  margin-top: -4px;
}
.modal-close:hover { color: var(--red); }

/* ── Animations ── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .login-card { margin: 12px; padding: 30px 22px 26px; }
  .modal-box  { width: calc(100vw - 32px); padding: 26px 18px 20px; }
}

/* ── Prevent card width change when long alert text appears ── */
.alert {
  word-break: break-word;
  white-space: normal;
  box-sizing: border-box;
  width: 100%;
}
.login-card {
  width: 400px !important;
}
@media (max-width: 440px) {
  .login-card { min-width: unset !important; width: calc(100vw - 24px) !important; }
}

/* ── OTP Login button (outline style in step 2) ── */
.btn-otp-login {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: var(--blue-main);
  border: 1.5px solid var(--blue-main);
  border-radius: var(--radius);
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 4px;
}
.btn-otp-login:hover { background: var(--blue-main); color: #fff; }

/* ── OR divider ── */
.otp-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.otp-divider::before, .otp-divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border);
}

/* ── 4-box OTP input ── */
.otp-input-group {
  display: flex; gap: 12px; justify-content: center;
  margin: 18px 0 12px;
}
.otp-box {
  width: 56px; height: 58px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--input-bg);
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  color: var(--blue-dark);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  caret-color: var(--blue-main);
}
.otp-box:focus {
  border-color: var(--blue-main);
  box-shadow: 0 0 0 3px rgba(59,89,152,.14);
  background: #fff;
}
.otp-box.filled { border-color: var(--green); }

/* ── OTP timer / info text ── */
.otp-timer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}
.otp-timer.urgent { color: var(--red); font-weight: 700; }
.otp-info-text {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

/* ── Spinner support for btn-text class ── */
.btn-signin.loading .btn-text { display: none; }
