/* ============================================================
   forgot-password.css
   Forgot Password + Reset Password pages & modal — Thesis Hub
   Depends on variables defined in login.css (loaded first)
   ============================================================ */

.fp-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.fp-card {
    width: 100%;
    max-width: 440px;
    background: var(--card);
    border-radius: var(--r-lg);
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    padding: clamp(26px, 5vw, 44px) clamp(18px, 5vw, 40px);
    position: relative;
    overflow: hidden;
    margin: auto;
}

.fp-card-top-accent {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--indigo) 0%, var(--indigo-hover) 100%);
}

.fp-header {
    text-align: center;
    margin-bottom: clamp(20px, 3vh, 28px);
}

.fp-icon-wrap {
    display: inline-flex;
    padding: 8px;
    border: 1px dashed #cbd5e1;
    border-radius: var(--r-md);
    margin-bottom: 14px;
    background: #f8fafc;
}

.fp-icon-inner {
    width: 48px;
    height: 48px;
    background: var(--indigo-soft);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--indigo);
    font-size: 1.6rem;
}

.fp-header h1 {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -.4px;
    line-height: 1.25;
}

.fp-header p {
    color: var(--text-muted);
    font-size: clamp(0.83rem, 2.5vw, 0.9rem);
    margin-top: 8px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.fp-strength {
    margin-top: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.fp-strength-bars {
    display: flex;
    gap: 4px;
    flex: 1 1 120px;
}

.fp-strength-bars span {
    height: 5px;
    flex: 1;
    border-radius: 3px;
    background: #e5e7eb;
    transition: background .2s;
}

.fp-strength-label {
    font-size: .75rem;
    font-weight: 600;
    color: #9aa5b4;
    white-space: nowrap;
    min-width: 72px;
    text-align: right;
}

.fp-match-hint {
    font-size: .8rem;
    font-weight: 600;
    margin-top: 6px;
    min-height: 18px;
}

.fp-match-hint.match-ok  { color: var(--success); }
.fp-match-hint.match-bad { color: var(--danger); }

/* ---------- Utility ---------- */

.d-none { display: none !important; }

/* ---------- Modal overlay ---------- */

.fp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 56, 105, 0.55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.fp-modal-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    background: var(--card);
    border-radius: var(--r-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    padding: clamp(26px, 5vw, 40px) clamp(18px, 5vw, 36px);
    margin: auto;
    animation: fpModalIn .18s ease-out;
}

@keyframes fpModalIn {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fp-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}
.fp-modal-close:hover { background: #e2e8f0; color: var(--navy); }

/* ---------- OTP inputs (fluid 6-box layout that never overflows narrow phones) ---------- */

.fp-otp-inputs {
    display: flex;
    gap: clamp(5px, 1.8vw, 10px);
    justify-content: center;
    width: 100%;
}

.fp-otp-box {
    flex: 1 1 0;
    max-width: 46px;
    min-width: 0;
    height: clamp(44px, 12vw, 52px);
    text-align: center;
    font-size: clamp(1.05rem, 4vw, 1.3rem);
    font-weight: 700;
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    background: #fafafa;
    color: var(--text-main);
    outline: none;
    font-family: var(--font-sans);
    padding: 0;
}
.fp-otp-box:focus {
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px var(--indigo-soft);
    background: #fff;
}

/* ---------- Resend link ---------- */

.fp-resend-link {
    background: none;
    border: none;
    padding: 2px 4px;
    color: var(--indigo);
    font-weight: 600;
    font-size: inherit;
    cursor: pointer;
    touch-action: manipulation;
}
.fp-resend-link:hover { text-decoration: underline; }
.fp-resend-link:disabled { color: var(--text-light); cursor: not-allowed; text-decoration: none; }

/* ---------- Forgot-link button reset (was an <a>, now a <button>) ---------- */

button.forgot-link {
    background: none;
    border: none;
    padding: 4px 0;
    font: inherit;
    cursor: pointer;
}

/* ---------- Mobile & Landscape Modal Refinements ---------- */

@media (max-width: 480px) {
    .fp-modal-overlay {
        padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    }
    .fp-modal-card,
    .fp-card {
        border-radius: 20px;
    }
    .fp-icon-inner {
        width: 42px;
        height: 42px;
        font-size: 1.4rem;
    }
}

@media (max-height: 580px) and (orientation: landscape) {
    .fp-modal-overlay,
    .fp-page {
        align-items: flex-start;
    }
    .fp-modal-card {
        max-height: none;
        padding: 22px 24px;
    }
}
