/* ===================================================
   FIDELITY LOGIN CLONE — styles.css  (2026)
   =================================================== */

/* ---------- Variables ---------- */
:root {
  --fid-green:        #007000;
  --fid-green-hover:  #005a00;
  --fid-green-light:  #e8f5e8;
  --fid-link:         #006FAD;
  --fid-link-hover:   #004d7a;
  --fid-bg:           #f0efed;
  --fid-card-bg:      #ffffff;
  --fid-border:       #c7c7c7;
  --fid-border-focus: #007000;
  --fid-text:         #1a1a1a;
  --fid-text-muted:   #555555;
  --fid-error:        #c0392b;
  --fid-error-bg:     #fdf2f2;
  --fid-radius:       4px;
  --fid-shadow:       0 2px 16px rgba(0,0,0,0.10);
  --fid-font:         'Helvetica Neue', Helvetica, Arial, sans-serif;
  --transition:       0.2s ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--fid-font);
  background: var(--fid-bg);
  color: var(--fid-text);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: var(--fid-link); text-decoration: none; }
a:hover { color: var(--fid-link-hover); text-decoration: underline; }
button { font-family: var(--fid-font); cursor: pointer; }

/* ---------- Page show/hide ---------- */
.fid-page { display: none; flex-direction: column; min-height: 100vh; }
.fid-page.active { display: flex; }

/* ---------- Header ---------- */
.fid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  padding: 0 32px;
  height: 60px;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 100;
}
.fid-logo-link { display: flex; align-items: center; }
.fid-logo { height: 36px; width: auto; display: block; }
.fid-nav { display: flex; gap: 28px; }
.fid-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--fid-text);
  text-decoration: none;
}
.fid-nav a:hover { text-decoration: underline; color: var(--fid-text); }

/* ---------- Main ---------- */
.fid-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
}

/* ---------- Card ---------- */
.fid-card {
  background: var(--fid-card-bg);
  border-radius: var(--fid-radius);
  box-shadow: var(--fid-shadow);
  width: 100%;
  max-width: 420px;
  padding: 40px 40px 36px;
}
.fid-card h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--fid-text);
  margin-bottom: 24px;
  letter-spacing: -0.3px;
}

/* ---------- Fields ---------- */
.fid-field { margin-bottom: 20px; }
.fid-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--fid-text);
}
.fid-field input[type="text"],
.fid-field input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid var(--fid-border);
  border-radius: var(--fid-radius);
  background: #fff;
  color: var(--fid-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.fid-field input:focus {
  border-color: var(--fid-border-focus);
  box-shadow: 0 0 0 2px rgba(0,112,0,0.18);
}
.fid-field.has-error input {
  border-color: var(--fid-error);
  box-shadow: 0 0 0 2px rgba(192,57,43,0.15);
}
.fid-field-error {
  font-size: 13px;
  color: var(--fid-error);
  margin-top: 5px;
  display: none;
}
.fid-field.has-error .fid-field-error { display: block; }

/* ---------- Password wrapper ---------- */
.fid-pw-wrap { position: relative; }
.fid-pw-wrap input { padding-right: 44px; }
.fid-eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  color: #555;
  display: flex;
  align-items: center;
}
.fid-eye-btn svg { width: 20px; height: 20px; }
.fid-eye-btn:hover { color: #111; }

/* ---------- Inline error (red bar) ---------- */
.fid-inline-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--fid-error-bg);
  border-left: 4px solid var(--fid-error);
  color: var(--fid-error);
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 0 var(--fid-radius) var(--fid-radius) 0;
  margin-bottom: 16px;
  animation: fid-shake 0.4s ease;
}
.fid-inline-error svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

/* ---------- Checkbox ---------- */
.fid-remember { margin-bottom: 20px; }
.fid-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.fid-checkbox-label input[type="checkbox"] { display: none; }
.fid-checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--fid-border);
  border-radius: 2px;
  flex-shrink: 0;
  position: relative;
  background: #fff;
  transition: all var(--transition);
}
.fid-checkbox-label input:checked ~ .fid-checkmark {
  background: var(--fid-green);
  border-color: var(--fid-green);
}
.fid-checkbox-label input:checked ~ .fid-checkmark::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 6px; height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

/* ---------- Green button ---------- */
.fid-btn-green {
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--fid-green);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
  letter-spacing: 0.2px;
}
.fid-btn-green:hover { background: var(--fid-green-hover); }
.fid-btn-green:active { transform: scale(0.98); }

/* ---------- Forgot / new account ---------- */
.fid-forgot { text-align: center; margin-top: 16px; font-size: 14px; }
.fid-new-account { margin-top: 20px; font-size: 14px; text-align: center; }

/* ---------- OTP card extras ---------- */
.fid-card--otp { padding: 32px 40px; }
.fid-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--fid-link);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 24px;
  padding: 0;
}
.fid-back-btn svg { width: 18px; height: 18px; }
.fid-back-btn:hover { color: var(--fid-link-hover); text-decoration: underline; }

.fid-otp-header { text-align: center; margin-bottom: 28px; }
.fid-otp-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.fid-otp-icon--phone { background: #e8f5e8; color: var(--fid-green); }
.fid-otp-icon--email { background: #e8f0fb; color: #1a73e8; }
.fid-otp-icon svg { width: 28px; height: 28px; }
.fid-otp-header h1 { font-size: 22px; margin-bottom: 8px; }
.fid-otp-header p  { font-size: 14px; color: var(--fid-text-muted); line-height: 1.6; }

/* ---------- OTP boxes ---------- */
.fid-otp-boxes {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}
.fid-otp-box {
  width: 46px; height: 54px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border: 2px solid var(--fid-border);
  border-radius: var(--fid-radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  color: var(--fid-text);
  background: #fff;
}
.fid-otp-box:focus {
  border-color: var(--fid-border-focus);
  box-shadow: 0 0 0 2px rgba(0,112,0,0.18);
}
.fid-otp-box.otp-error {
  border-color: var(--fid-error);
  box-shadow: 0 0 0 2px rgba(192,57,43,0.15);
  animation: fid-shake 0.4s ease;
}

/* ---------- Resend ---------- */
.fid-resend {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--fid-text-muted);
}
.fid-link-btn {
  background: none;
  border: none;
  color: var(--fid-link);
  font-size: 14px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}
.fid-link-btn:hover { color: var(--fid-link-hover); text-decoration: underline; }

/* ---------- Success card ---------- */
.fid-card--success {
  text-align: center;
  padding: 48px 40px;
}
.fid-success-icon { margin-bottom: 20px; }
.fid-success-icon svg { width: 64px; height: 64px; }
.fid-card--success h1 { font-size: 24px; margin-bottom: 10px; }
.fid-card--success p  { color: var(--fid-text-muted); font-size: 15px; }

/* ---------- Spinner ---------- */
.fid-spinner { margin: 24px auto 0; width: 36px; height: 36px; }
.fid-spinner-ring {
  width: 36px; height: 36px;
  border: 3px solid #d0e8d0;
  border-top-color: var(--fid-green);
  border-radius: 50%;
  animation: fid-spin 0.8s linear infinite;
}

/* ---------- Footer ---------- */
.fid-footer {
  border-top: 1px solid #ddd;
  background: #fff;
  padding: 20px 32px;
  margin-top: auto;
}
.fid-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  font-size: 12px;
  color: #666;
  line-height: 2;
}
.fid-footer-links a { color: #444; font-size: 12px; }
.fid-footer-links a:hover { text-decoration: underline; }

/* ---------- Animations ---------- */
@keyframes fid-shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
@keyframes fid-spin {
  to { transform: rotate(360deg); }
}
@keyframes fid-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fid-page.active .fid-card { animation: fid-fadein 0.25s ease; }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .fid-card, .fid-card--otp, .fid-card--success {
    padding: 28px 20px;
    border-radius: 0;
    box-shadow: none;
  }
  .fid-main { padding: 24px 0; justify-content: flex-start; }
  .fid-otp-box { width: 40px; height: 48px; font-size: 18px; }
  .fid-header { padding: 0 16px; }
}
