/* Reset */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root{
  --card-bg: rgba(255,255,255,0.14);
  --card-border: rgba(255,255,255,0.35);
  --text: #ffffff;
  --muted: rgba(255,255,255,0.75);
  --shadow: 0 10px 40px rgba(0,0,0,0.35);
  --radius: 20px;
  --gradient: linear-gradient(135deg, #0a5133, #49eda6);
  --gradient-hover: linear-gradient(135deg, #4ba27c, #4ba27c);
  --desktop-gap: clamp(90px, 8vw, 180px);

  /* shared height for all fields (also used in modal) */
  --field-h: 52px;
}

html, body { height: 100%; }
body {
  font-family: 'Poppins', Arial, sans-serif;
  min-height: 100dvh;
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  -webkit-tap-highlight-color: transparent;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.30)),
    url('trynga.png') center/cover no-repeat;
  filter: blur(4px);
  z-index: -2;
}

/* Layout */
.content-wrapper{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--desktop-gap);
  width: min(1200px, 96%);
  margin: 0 auto;
  padding: 2rem 1rem;
}
@media (min-width: 1200px){
  .content-wrapper{ width: min(1400px, 96%); }
}

.hero-section { flex: 1; max-width: 50%; }

/* Login card side */
.container{
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

/* Card */
.form-container.glass{
  width: min(92vw, 500px);
  padding: 40px 32px;
  border-radius: var(--radius);
  color: var(--text);
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  text-align: center;
}

.fade-in{ animation: fadeIn .9s ease-out both; }
@keyframes fadeIn{ from{opacity:0; transform:translateY(-14px)} to{opacity:1; transform:translateY(0)} }

.logo img{ max-width:150px; height:auto; margin-bottom:14px; filter:drop-shadow(0 3px 8px rgba(0,0,0,.25)); }

.title{ font-weight:600; letter-spacing:.2px; margin:6px 0 18px; }

/* HERO (desktop exact look) */
.hero-title{
  font-size: 5rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 14px;
  line-height: 1.15;
  text-wrap: balance;
}
.hero-title span{
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-tagline{ font-size: 1.1rem; color: var(--muted); }

/* Inputs */
.input,
input[type="email"],
input[type="password"]{
  width: 100%;
  padding: 14px 14px;
  border: none; border-radius: 12px; outline: none;
  font-size: 16px;
  color: #222; background: rgba(255,255,255,0.9);
  margin: 10px 0 12px;
}
.input-label{
  display:block; text-align:left; font-size:14px; font-weight:600;
  color: var(--muted); margin: 6px 0 4px 2px;
}
.input::placeholder{ color:#9aa0a6; opacity:1; }

/* Password eye (login page only; modal uses its own scoped rules) */
.input-group.password-wrapper{ position: relative; }
.toggle-password{
  position: absolute; right: 12px; top: 65%; transform: translateY(-50%);
  color:#6a6a6a; font-size:18px; width:34px; height:34px; border:0; background:transparent;
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer;
}

/* Row */
.row-between{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin:10px 0 6px;
}

/* Checkbox */
.checkbox{ display:flex; align-items:center; gap:8px; }
.checkbox label{ color:var(--muted); font-size:13px; font-weight:500; }

/* Buttons */
.btn-gradient{
  width:100%; padding:14px 14px; border:none; border-radius:12px;
  background:var(--gradient); color:#fff; font-size:17px; font-weight:600; cursor:pointer;
  margin-top:12px; transition: transform .06s ease, box-shadow .2s ease, background .2s ease;
  box-shadow:0 8px 18px rgba(118,75,162,.35);
}
.btn-gradient:hover{ background:var(--gradient-hover); }
.btn-gradient:active{ transform: translateY(1px); }

.link{ color:#fff; font-weight:600; text-decoration:none; }
.link:hover{ text-decoration:underline; }
.link.subtle{ color:var(--muted); font-weight:500; }

.signup{ margin-top:14px; color:var(--muted); font-size:14px; }

.back-wrap{ margin-top:18px; }
.btn-back{
  display:inline-block; padding:10px 14px; border-radius:12px; background:transparent; color:var(--text);
  font-size:15px; font-weight:600; text-decoration:none; border:1px solid var(--card-border);
  transition: background .2s, color .2s, border-color .2s;
}
.btn-back:hover{ background:var(--gradient); color:#fff; border-color:transparent; }

/* Error */
.error{
  display:none; background:rgba(255,243,205,.95); border:1px solid #ffe69c; color:#8a6d3b;
  padding:10px 12px; border-radius:10px; margin:8px 0 10px; text-align:center; font-size:14px;
}
.error.active{ display:block; }

/* ========== Forgot Password Modal (SCOPED) ========== */

/* Backdrop + container */
#forgot-modal{
  position: fixed;
  inset: 0;
  display: none;                 /* shown via JS */
  align-items: center;
  justify-content: center;
  background: rgba(10,10,10,.45);
  backdrop-filter: blur(8px);
  z-index: 99;
}

#forgot-modal .modal-content{
  animation: modalPop .18s ease;
  color: var(--text);
  background: rgba(10,81,51,.14);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  width: 92%;
  max-width: 520px;
  border-radius: 16px;
  padding: 26px 24px 22px;
  position: relative;
}

@keyframes modalPop{
  from { opacity:.6; transform:scale(.96) }
  to   { opacity:1; transform:scale(1) }
}

#forgot-modal .close-modal{
  color:#ddd;
  cursor:pointer;
  font-size:26px;
  font-weight:700;
  position:absolute;
  right:16px;
  top:10px;
}

/* Headings & labels */
#forgot-modal h3{
  font-weight:700;
  letter-spacing:.2px;
  margin-bottom:12px;
}

#forgot-modal form label{
  display:block;
  font-size:14px;
  font-weight:600;
  color:var(--muted);
  margin:10px 0 6px 2px;
}

/* Modal inputs – same length/height as main form */
#forgot-modal input[type="email"],
#forgot-modal input[type="password"],
#forgot-modal input[type="text"]{
  width: 100%;
  height: var(--field-h);
  line-height: var(--field-h);
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.9);
  color: #222;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  display:block;
}

#forgot-modal input:focus{
  border-color:#7ef5c6;
  box-shadow:0 0 0 3px rgba(126,245,198,.25);
}

/* Field-level error message under the email input */
#forgot-modal .field-error{
  margin:4px 2px 0;
  font-size:12px;
  color:#ffdddd;
  text-shadow:0 0 2px rgba(0,0,0,0.6);
  display:block;
  text-align:left !important; 
}


/* Red border + glow when JS marks the field as error/invalid */
#forgot-modal input.error,
#forgot-modal input.is-invalid{
  border-color:#ff6b6b !important;
  box-shadow:0 0 0 3px rgba(255,107,107,.35) !important;
}

.error{
  display:none;
  background:rgba(255,243,205,.95);
  border:1px solid #ffe69c;
  color:#8a6d3b;
  padding:10px 12px;
  border-radius:10px;
  margin:8px 0 10px;
  text-align:left;   /* changed from center */
  font-size:14px;
}


#forgot-modal input:disabled{
  opacity:.7;
  cursor:not-allowed;
}

/* Code row */
#forgot-modal .modal-code-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:8px;
}
#forgot-modal .modal-code-input{ flex:1; }
#forgot-modal .modal-code-input input{ height: var(--field-h); }
#forgot-modal .modal-code-btn{
  height: var(--field-h);
  padding: 0 14px;
  border:none;
  border-radius:12px;
  background:var(--gradient);
  color:#fff;
  font-weight:700;
  cursor:pointer;
  transition: transform .06s ease, box-shadow .2s ease, background .2s ease;
  box-shadow:0 8px 18px rgba(118,75,162,.35);
  white-space:nowrap;
}
#forgot-modal .modal-code-btn:hover{ background:var(--gradient-hover); }
#forgot-modal .modal-code-btn:disabled{
  background:#bdbdbd; color:#555; cursor:not-allowed; box-shadow:none;
}

/* Countdown */
#forgot-modal .countdown-text{
  display:inline-block;
  margin:6px 2px 0;
  font-size:12px;
  font-weight:700;
  color:#7ef5c6;
}

/* -------- Password fields in the modal (eye INSIDE & perfectly centered) -------- */
#forgot-modal .password-wrapper{
  position: relative;            /* anchor for absolute eye */
  margin-bottom: 10px;
}

/* Keep field a fixed height and reserve space for the eye to prevent movement */
#forgot-modal .password-wrapper > input[type="password"],
#forgot-modal .password-wrapper > input[type="text"]{
  width: 100%;
  height: var(--field-h);
  line-height: var(--field-h);
  padding: 0 14px;
  padding-right: 48px;           /* space for eye */
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px;
  background: rgba(255,255,255,.9);
  color:#222;
  display:block;
  box-sizing:border-box;
}

/* Eye button: centered on the INPUT row (won't shift on toggle) */
#forgot-modal .password-wrapper .toggle-password{
  position: absolute;
  right: 10px;
  top: 0;                        /* sit in the input row */
  height: var(--field-h);        /* same height as input row */
  width: 32px;                   /* click target */
  background: transparent;
  border: 0;
  color: #6a6a6a;
  display: flex;
  align-items: center;           /* vertical center inside input height */
  justify-content: center;
  cursor: pointer;
  line-height: 0;
  z-index: 2;
  transform: none;               /* no translate – true centering */
}
#forgot-modal .password-wrapper .toggle-password i{
  font-size: 18px;
  width: 18px;                   /* lock width so text never nudges */
  text-align:center;
}
#forgot-modal .password-wrapper .toggle-password:hover{ color:#3a3a3a; }

/* Strength meter lives BELOW the input and never affects its height */
#forgot-modal .meter-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin:8px 0 0;
  position: relative;
  z-index: 1;
}
#forgot-modal .strength-bar{
  position:relative;
  width:180px;
  height:8px;
  border-radius:6px;
  background:rgba(0,0,0,.28);
  overflow:hidden;
}
#forgot-modal .strength-bar .strength-fill{
  position:absolute; left:0; top:0; height:100%; width:0%;
  background:#ff6b6b; transition:width .18s ease;
}
#forgot-modal .strength-bar.strength-1 .strength-fill{ background:#ff9248; }
#forgot-modal .strength-bar.strength-2 .strength-fill{ background:#ffd166; }
#forgot-modal .strength-bar.strength-3 .strength-fill{ background:#a2f59b; }
#forgot-modal .strength-bar.strength-4 .strength-fill{ background:#66ff99; }
#forgot-modal .strength-text{ font-size:12px; color:#e9fff6; opacity:.9; }

/* Password rules tooltip */
#forgot-modal .password-requirements-popup{
  list-style: disc inside;
  background: rgba(14,55,40,.95);
  border: 1px solid rgba(126,245,198,.35);
  color: #eafff7;
  border-radius: 12px;
  padding: 10px 12px;
  position: absolute;
  left: 0;
  top: calc(var(--field-h) + 2px);  /* directly under input height */
  width: min(360px, calc(100% - 8px));
  z-index: 6;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  visibility: hidden;
  opacity: 0;
  transition: opacity .14s ease, visibility 0s linear .14s;
}
#forgot-modal .password-requirements-popup::before{
  content:"";
  position:absolute; top:-5px; left:16px;
  border-width:5px; border-style:solid;
  border-color: transparent transparent rgba(14,55,40,.95) transparent;
  filter: drop-shadow(0 -1px 0 rgba(126,245,198,.35));
}
#forgot-modal .password-requirements-popup li{ opacity:.95; font-size:13px; margin:2px 0; }
#forgot-modal .password-requirements-popup li.valid{ opacity:1; color:#66ff99; font-weight:600; }
#forgot-modal .password-wrapper:has(#fp-password:focus) .password-requirements-popup,
#forgot-modal .password-wrapper:hover .password-requirements-popup,
#forgot-modal .password-requirements-popup:hover{
  visibility: visible; opacity: 1; transition-delay: 0s;
}

/* Confirm status tooltip */
#forgot-modal .confirm-wrapper{ position: relative; }
#forgot-modal .confirm-status{
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(20,20,20,.9);
  color: #f2fffb;
  position: absolute; left: 0; top: calc(100% + 4px);
  width: min(320px, calc(100% - 8px));
  z-index: 6;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none; opacity: 0; transition: opacity .14s ease;
}
#forgot-modal .confirm-status::before{
  content:""; position:absolute; top:-5px; left:16px;
  border-width:5px; border-style:solid;
  border-color: transparent transparent rgba(20,20,20,.9) transparent;
}
#forgot-modal .confirm-status.visible{ display: block; opacity: 1; }
#forgot-modal .confirm-status.is-match{
  border-color: rgba(102,255,153,.6);
  background: rgba(14,55,40,.95);
  color: #aefad0; font-weight: 700;
}
#forgot-modal .confirm-status.is-mismatch{
  border-color: rgba(255,107,107,.6);
  background: rgba(60,10,10,.95);
  color: #ffc1c1; font-weight: 700;
}

/* Submit button inside modal */
#forgot-modal #fp-change-btn{
  width:100%;
  height: var(--field-h);
  padding: 0 14px;
  border:none; border-radius:12px;
  background:var(--gradient); color:#fff;
  font-size:16px; font-weight:700; cursor:pointer;
  margin-top:12px; transition: transform .06s ease, box-shadow .2s ease, background .2s ease;
  box-shadow:0 8px 18px rgba(118,75,162,.35);
}
#forgot-modal #fp-change-btn:hover{ background:var(--gradient-hover); }
#forgot-modal #fp-change-btn:disabled{ background:#bdbdbd; color:#666; cursor:not-allowed; box-shadow:none; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px){ .hero-title { font-size: 4rem; } }
@media (max-width: 992px){
  .content-wrapper{ gap: clamp(40px, 5vw, 80px); width: min(1000px, 96%); }
  .hero-section{ max-width: 52%; }
  .hero-title{ font-size: 3.2rem; }
}
@media (max-width: 820px){
  .content-wrapper{ flex-direction: column; justify-content: center; align-items: center; gap: 1.25rem; padding: 1.25rem 1rem; padding-top: calc(env(safe-area-inset-top, 0px) + 72px); }
  .hero-section{ max-width: 720px; width: 100%; margin-bottom: 12px; text-align: center; display: flex; align-items: center; justify-content: center; flex-direction: column; }
  .hero-title{ font-size: clamp(1.45rem, 6vw, 1.85rem); line-height: 1.12; margin-bottom: 6px; letter-spacing: -0.2px; }
  .hero-tagline{ font-size: .98rem; text-align: center; }
  .container{ width: 100%; justify-content: center; }
  .form-container.glass{ width: min(94vw, 520px); padding: 28px 22px; }
  .row-between{ gap: 10px; }
}
/* ----- PHONE BEHAVIOR: show guidelines BELOW the strength bar ----- */
@media (max-width: 480px){
  /* Put guidelines into normal flow right under the meter */
  #forgot-modal .password-requirements-popup{
    position: static;      /* no absolute positioning */
    width: 100%;
    left: auto; 
    top: auto;
    margin-top: 10px;      /* below the strength bar */
    visibility: visible;   /* always shown on mobile */
    opacity: 1;
    transition: none;      /* no fade when in-flow */
  }
  /* Hide the little arrow since it's no longer a tooltip */
  #forgot-modal .password-requirements-popup::before{
    display: none;
  }
}
@media (max-width: 360px){ .hero-title{ font-size: 1.28rem; } }
