/* =====================================================================
   RDB CRM — Login System Styles
   Replicates the provided mockups: Sign In / Forgot UID-Password /
   UID reveal / OTP verify / New Password screens.
   ===================================================================== */

:root{
  --navy:        #1c2b4a;
  --navy-dark:   #16223a;
  --cream:       #efe9d8;
  --cream-soft:  rgba(239, 233, 216, 0.92);
  --gold-glass:  rgba(214, 176, 96, 0.16);
  --accent:      #c1531f;
  --text-dark:   #202634;
  --text-muted:  #5b6472;
  --error:       #c0392b;
  --success:     #1e7e42;
  --radius-lg:   28px;
  --radius-md:   14px;
  --radius-pill: 999px;
  --font-serif:  Georgia, 'Times New Roman', 'Noto Serif', serif;
  --font-sans:   'Segoe UI', 'Noto Sans', 'Noto Sans Devanagari', Arial, sans-serif;
}

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

html, body{
  height: 100%;
}

body{
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------------------------------------------------------------------
   Full-bleed background photo, dimmed with a navy overlay
   --------------------------------------------------------------------- */
.auth-page{
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background-image:
    linear-gradient(rgba(10, 18, 36, 0.55), rgba(10, 18, 36, 0.62)),
    url('../images/bg-desktop.jpg');
  background-size: cover;
  background-position: center;
  padding: 40px 80px;
}

.brand-panel{
  position: absolute;
  left: 8%;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #fff;
  max-width: 360px;
}

.brand-panel img{
  width: 190px;
  height: 190px;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.35));
  margin-bottom: 18px;
}

.brand-wordmark{
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.4;
}

.brand-wordmark .crm{
  display: block;
  font-size: 4.2rem;
  font-weight: 800;
  letter-spacing: 2px;
  line-height: 1;
  margin-top: 6px;
}

/* ---------------------------------------------------------------------
   The big translucent gold "glass" panel that frames each step
   --------------------------------------------------------------------- */
.glass-panel{
  width: 100%;
  max-width: 620px;
  background: var(--gold-glass);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-lg);
  padding: 56px 64px;
}

.step-title{
  font-family: var(--font-serif);
  font-size: 2.1rem;
  color: #fff;
  margin: 0 0 8px 0;
  position: relative;
  display: block;
}

.step-title::after{
  content: '';
  display: block;
  width: 62px;
  height: 3px;
  background: var(--accent);
  margin-top: 10px;
  border-radius: 2px;
}

.step-subtitle{
  color: rgba(255,255,255,0.85);
  font-size: 0.92rem;
  margin: 14px 0 0 0;
}

/* ---------------------------------------------------------------------
   Inner cream "card" holding the actual form controls
   --------------------------------------------------------------------- */
.form-card{
  background: var(--cream-soft);
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  margin-top: 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.field{
  position: relative;
  margin-bottom: 26px;
}
.field:last-of-type{ margin-bottom: 0; }

.field label{
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}

.field .input-wrap{
  position: relative;
  border-bottom: 1.5px solid var(--navy);
  padding-bottom: 4px;
}

.field input{
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1.05rem;
  color: var(--text-dark);
  padding: 6px 34px 6px 2px;
  font-family: var(--font-sans);
}

.field input::placeholder{ color: #8b8577; }

.field input:disabled{
  color: var(--text-dark);
  -webkit-text-fill-color: var(--text-dark);
  opacity: 1;
}

.toggle-visibility{
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
}
.toggle-visibility svg{ width: 20px; height: 20px; }

.field-meta{
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.field-meta .timer{ font-weight: 600; color: var(--text-dark); }

.field-meta button.link-btn{
  background: none;
  border: none;
  padding: 0;
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.78rem;
  text-decoration: underline;
}
.field-meta button.link-btn:disabled{
  color: #a9a397;
  cursor: not-allowed;
  text-decoration: none;
}

.form-row{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 22px 0;
  font-size: 0.82rem;
}

.remember{
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dark);
}
.remember input{ accent-color: var(--navy); width: 15px; height: 15px; }

.links-row{
  display: flex;
  gap: 6px;
  color: var(--navy);
  font-weight: 600;
}
.links-row button{
  background: none;
  border: none;
  padding: 0;
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.82rem;
  text-decoration: none;
}
.links-row button:hover{ text-decoration: underline; }
.links-row .divider{ color: var(--text-muted); font-weight: 400; }

.btn-primary{
  display: block;
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--navy);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.btn-primary:hover{ background: var(--navy-dark); }
.btn-primary:active{ transform: scale(0.99); }
.btn-primary:disabled{
  background: #8891a3;
  cursor: not-allowed;
}

.btn-back{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 18px;
  font-size: 0.9rem;
  padding: 0;
}
.btn-back svg{ width: 16px; height: 16px; }

.msg-banner{
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.88rem;
  margin-bottom: 20px;
  display: none;
}
.msg-banner.show{ display: block; }
.msg-banner.error{ background: rgba(192,57,43,0.14); color: var(--error); border: 1px solid rgba(192,57,43,0.3); }
.msg-banner.success{ background: rgba(30,126,66,0.14); color: var(--success); border: 1px solid rgba(30,126,66,0.3); }

.uid-reveal-box{
  text-align: center;
  padding: 18px 0 6px 0;
}
.uid-reveal-box .revealed-uid{
  font-family: var(--font-serif);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 3px;
  margin: 10px 0 6px 0;
}

.step{ display: none; }
.step.active{ display: block; animation: fadeIn 0.25s ease; }

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

.dev-otp-hint{
  font-size: 0.76rem;
  color: var(--text-muted);
  background: rgba(28,43,74,0.08);
  border: 1px dashed rgba(28,43,74,0.3);
  border-radius: 8px;
  padding: 8px 12px;
  margin-top: 16px;
  text-align: center;
}

/* ---------------------------------------------------------------------
   Responsive: mobile layout, stacked, parade-photo background
   --------------------------------------------------------------------- */
@media (max-width: 900px){
  .auth-page{
    flex-direction: column;
    background-image:
      linear-gradient(rgba(10, 18, 36, 0.6), rgba(10, 18, 36, 0.72)),
      url('../images/bg-mobile.jpg');
    justify-content: flex-start;
    align-items: center;
    padding: 40px 20px 60px 20px;
  }

  .brand-panel{
    position: static;
    transform: none;
    margin: 0 auto 22px auto;
    max-width: 100%;
    order: -1;
  }
  .brand-panel img{ width: 110px; height: 110px; margin-bottom: 10px; }
  .brand-wordmark{ font-size: 1.15rem; }
  .brand-wordmark .crm{ font-size: 2.4rem; }

  .page-wrap{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .glass-panel{
    max-width: 480px;
    width: 100%;
    padding: 6px 4px 24px 4px;
    background: transparent;
    backdrop-filter: none;
  }

  .step-title{ font-size: 1.5rem; text-align: center; width: 100%; }
  .step-title::after{ margin: 10px auto 0 auto; }
  .step-subtitle{ text-align: center; }

  .form-card{
    padding: 26px 22px;
    margin-top: 18px;
  }

  .form-row{
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .links-row{ flex-wrap: wrap; }
}

@media (max-width: 420px){
  .form-card{ padding: 22px 16px; }
  .glass-panel{ padding: 4px 2px 20px 2px; }
}

/* Accessible focus states */
.field input:focus-visible,
.btn-primary:focus-visible,
button:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .step.active{ animation: none; }
}
