/* JSJB Forgot Password – Government / NIC portal (aligned with login.css) */

.fp-page {
    background: #f5f7fb;
    min-height: 100vh;
    color: #222;
}

.fp-skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.fp-skip-link:focus {
    position: fixed;
    left: 16px;
    top: 16px;
    width: auto;
    height: auto;
    padding: 10px 16px;
    background: #003b8e;
    color: #fff;
    z-index: 10000;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
}

/* Prevent login.css form-group spacing inside forgot-password card */
.fp-card .form-group {
    margin-bottom: 0;
}

/* ── Main content ── */
.fp-main {
    padding: 20px 16px 32px;
}

.fp-main .container {
    max-width: 640px;
    margin: 0 auto;
}

.fp-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e8ecf2;
}

.fp-card-header {
    padding: 18px 22px 0;
    text-align: center;
}

.fp-card-header h2 {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #003b8e;
}

.fp-card-header p {
    margin: 0;
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.5;
}

/* ── Step progress tracker ── */
.fp-progress {
    padding: 14px 22px 4px;
}

.fp-progress-track {
    height: 3px;
    background: #e2e8f0;
    border-radius: 999px;
    margin: 0 16px 10px;
    overflow: hidden;
}

.fp-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #003b8e 0%, #0056d2 100%);
    border-radius: 999px;
    transition: width 0.35s ease;
}

.fp-progress-steps {
    display: flex;
    justify-content: space-between;
    list-style: none;
    margin: 0;
    padding: 0 8px;
    gap: 8px;
}

.fp-progress-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    min-width: 0;
}

.fp-progress-marker {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.125rem;
    transition: all 0.25s ease;
}

.fp-progress-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #94a3b8;
    line-height: 1.2;
}

.fp-progress-step.active .fp-progress-marker {
    border-color: #003b8e;
    background: #003b8e;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 59, 142, 0.15);
}

.fp-progress-step.active .fp-progress-label {
    color: #003b8e;
}

.fp-progress-step.completed .fp-progress-marker {
    border-color: #059669;
    background: #059669;
    color: #fff;
}

.fp-progress-step.completed .fp-progress-label {
    color: #059669;
}

/* Legacy step ids (JS toggles these classes too) */
.fp-steps { display: none; }

/* ── Card body & forms ── */
.fp-card-body {
    padding: 4px 22px 18px;
}

.fp-form-group {
    margin-bottom: 12px;
}

.fp-form-group:last-of-type {
    margin-bottom: 8px;
}

.fp-form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.fp-form-group .required {
    color: #dc2626;
    font-weight: 700;
}

.fp-form-group .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.875rem;
    min-height: 38px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.fp-form-group .form-control:focus {
    outline: none;
    border-color: #003b8e;
    box-shadow: 0 0 0 3px rgba(0, 59, 142, 0.12);
}

.fp-form-group .form-control::placeholder {
    color: #94a3b8;
}

/* Password field with toggle */
.fp-input-wrap {
    display: flex;
    align-items: stretch;
}

.fp-input-wrap .form-control {
    border-radius: 8px 0 0 8px;
    border-right: 0;
}

.fp-toggle-pwd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 0 8px 8px 0;
    background: #f8fafc;
    color: #003b8e;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.fp-toggle-pwd:hover,
.fp-toggle-pwd:focus {
    background: #003b8e;
    color: #fff;
    outline: none;
}

.fp-toggle-pwd:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 59, 142, 0.25);
}

.fp-toggle-pwd i {
    font-size: 1.25rem;
    line-height: 1;
}

/* ── Alerts & validation ── */
.fp-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 18px;
}

.fp-alert-icon {
    flex-shrink: 0;
    font-size: 1.125rem;
    margin-top: 1px;
}

.fp-msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 0.8125rem;
    line-height: 1.4;
    margin-bottom: 10px;
}

.fp-msg:empty {
    display: none !important;
    margin: 0;
    padding: 0;
}

.fp-msg::before {
    font-family: "Material Design Icons";
    font-size: 1.125rem;
    flex-shrink: 0;
    line-height: 1.4;
}

.fp-msg-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #2563eb;
    color: #1e40af;
}

.fp-msg-info::before {
    content: "\F02FC";
}

.fp-msg-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    color: #991b1b;
}

.fp-msg-error::before {
    content: "\F0028";
}

.fp-msg-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-left: 4px solid #059669;
    color: #065f46;
}

.fp-msg-success::before {
    content: "\F012C";
}

/* Server-side ForeColor overrides info styling for errors */
.fp-msg.fp-msg-info[style*="color:Red"],
.fp-msg.fp-msg-info[style*="color: Red"],
.fp-msg.fp-msg-info[style*="color:red"] {
    background: #fef2f2;
    border-color: #fecaca;
    border-left-color: #dc2626;
    color: #991b1b !important;
}

.fp-msg.fp-msg-info[style*="color:Red"]::before,
.fp-msg.fp-msg-info[style*="color: Red"]::before,
.fp-msg.fp-msg-info[style*="color:red"]::before {
    content: "\F0028";
}

#lblpnlpwdEmail:not(:empty) {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 18px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
    color: #991b1b;
}

.fp-validation {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 3px;
    line-height: 1.3;
}

.fp-validation::before {
    content: "\F0028";
    font-family: "Material Design Icons";
    font-size: 0.875rem;
}

/* ── Password strength & policy ── */
.fp-strength {
    margin-top: 6px;
}

.fp-strength-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}

.fp-strength-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.fp-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.25s ease, background 0.25s ease;
}

.fp-policy-panel {
    margin-top: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.fp-policy-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px 10px;
}

.fp-policy-checklist li {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    color: #64748b;
    line-height: 1.25;
}

.fp-policy-checklist li::before {
    content: "\F0131";
    font-family: "Material Design Icons";
    font-size: 1rem;
    color: #cbd5e1;
    flex-shrink: 0;
}

.fp-policy-checklist li.met {
    color: #065f46;
}

.fp-policy-checklist li.met::before {
    content: "\F012C";
    color: #059669;
}

/* ── Captcha ── */
.fp-captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.fp-captcha-row .form-control {
    flex: 1;
    min-width: 120px;
    margin-bottom: 0;
}

.fp-captcha-box {
    display: inline-flex;
    align-items: stretch;
    flex-shrink: 0;
    border: 1px solid #d0d7e2;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.fp-captcha-box .cap {
    display: block;
    height: 38px;
    width: auto;
    border: none;
    background: #fff;
    transition: opacity 0.2s ease;
}

.fp-captcha-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    padding: 0 10px;
    border: none;
    border-left: 1px solid #e8ecf2;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f8 100%);
    color: #003b8e;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.fp-captcha-refresh:hover,
.fp-captcha-refresh:focus {
    background: #003b8e;
    color: #fff;
    outline: none;
}

.fp-captcha-refresh i {
    font-size: 1.125rem;
    transition: transform 0.35s ease;
}

.fp-captcha-refresh:hover i,
.fp-captcha-refresh:focus i {
    transform: rotate(-180deg);
}

/* ── Buttons ── */
.fp-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 0;
}

.fp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 38px;
    border: none;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.fp-btn-primary {
    background: #0056d2;
    color: #fff;
    flex: 1;
    min-width: 140px;
}

.fp-btn-primary:hover {
    background: #003b8e;
}

.fp-btn-secondary {
    background: #fff;
    color: #003b8e;
    border: 1px solid #003b8e;
    flex: 1;
    min-width: 120px;
}

.fp-btn-secondary:hover {
    background: #eff6ff;
}

.fp-btn-secondary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.fp-btn-link {
    background: transparent;
    color: #64748b;
    border: 1px solid transparent;
    text-decoration: underline;
    min-width: auto;
    flex: 0 0 auto;
}

.fp-btn-link:hover {
    color: #003b8e;
}

.fp-timer {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #b45309;
    margin: 0 0 8px;
    padding: 6px 10px;
    background: #fffbeb;
    border-radius: 4px;
    border: 1px solid #fde68a;
}

.fp-timer:empty {
    display: none !important;
    margin: 0;
    padding: 0;
}

.fp-footer-note {
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e8ecf2;
    line-height: 1.4;
}

.fp-footer-note a {
    color: #003b8e;
    font-weight: 600;
    text-decoration: none;
}

.fp-footer-note a:hover {
    text-decoration: underline;
}

/* ── Page footer (portal) ── */
.fp-page-footer {
    background: #003b8e;
    color: #fff;
    padding: 14px 0;
    text-align: center;
    font-size: 0.8125rem;
}

.fp-page-footer a {
    color: #bfdbfe;
    text-decoration: none;
}

.fp-page-footer a:hover {
    text-decoration: underline;
}

/* ── Success modal ── */
.fp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

.fp-modal {
    background: #fff;
    border-radius: 12px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    padding: 32px 28px 28px;
    box-shadow: 0 20px 48px rgba(0, 59, 142, 0.2);
    border-top: 4px solid #059669;
}

.fp-modal-icon {
    font-size: 3.25rem;
    color: #059669;
    line-height: 1;
    margin-bottom: 14px;
}

.fp-modal-title {
    margin: 0 0 10px;
    font-size: 1.25rem;
    color: #003b8e;
    font-weight: 700;
}

.fp-modal-text {
    margin: 0 0 22px;
    font-size: 0.9375rem;
    color: #475569;
    line-height: 1.55;
}

.fp-modal-progress {
    height: 4px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

.fp-modal-progress-bar {
    height: 100%;
    width: 0;
    background: #003b8e;
    animation: fpRedirectProgress 4s linear forwards;
}

@keyframes fpRedirectProgress {
    from { width: 0; }
    to { width: 100%; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .fp-card-header {
        padding: 14px 16px 0;
    }

    .fp-card-header h2 {
        font-size: 1.25rem;
    }

    .fp-progress {
        padding: 12px 16px 2px;
    }

    .fp-progress-track {
        margin: 0 8px 8px;
    }

    .fp-progress-marker {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }

    .fp-progress-label {
        font-size: 0.6875rem;
    }

    .fp-card-body {
        padding: 4px 16px 14px;
    }

    .fp-policy-checklist {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .fp-main {
        padding: 20px 12px 40px;
    }

    .fp-progress-label {
        font-size: 0.6875rem;
    }

    .fp-btn-row {
        flex-direction: column;
    }

    .fp-btn {
        width: 100%;
        flex: none;
    }

    .fp-captcha-box {
        width: 100%;
    }

    .fp-captcha-box .cap {
        flex: 1;
        object-fit: contain;
    }

    .fp-captcha-refresh {
        min-width: 88px;
    }

    .header .container {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .logo-section {
        justify-content: center;
    }
}
