/* ============================================================
   Forgot Password Page — Coffee-Themed Design
   ============================================================ */

:root {
    --fp-espresso: #4E342E;
    --fp-coffee: #6F4E37;
    --fp-mocha: #8D6E63;
    --fp-latte: #D7CCC8;
    --fp-cream: #EFEBE9;
    --fp-bg: #F8F5F2;
    --fp-caramel: #B87333;
    --fp-error: #DC2626;
    --fp-error-light: #FEF2F2;
    --fp-success: #16A34A;
    --fp-success-light: #F0FDF4;
}

/* ---- Page Layout ---- */

.fp-page {
    min-height: 100vh;
    background: linear-gradient(160deg, #F8F5F2 0%, #EFEBE9 40%, #D7CCC8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 1.25rem 3rem;
}

.fp-container {
    width: 100%;
    max-width: 440px;
}

.fp-card {
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow:
        0 4px 6px rgba(78, 52, 46, 0.04),
        0 10px 30px rgba(78, 52, 46, 0.06),
        0 25px 60px rgba(78, 52, 46, 0.08);
    padding: 2.75rem 2.5rem;
    animation: fpFadeIn 400ms ease-out;
    position: relative;
    overflow: hidden;
}

.fp-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4E342E, #6F4E37, #B87333, #6F4E37, #4E342E);
}

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

/* ---- Logo ---- */

.fp-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 2rem;
}

.fp-logo svg {
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 2px 8px rgba(78, 52, 46, 0.15));
}

.fp-logo-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6F4E37;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ---- Header ---- */

.fp-header {
    text-align: center;
    margin-bottom: 2rem;
}

.fp-header h1 {
    font-size: 1.625rem;
    font-weight: 700;
    color: #4E342E;
    margin: 0 0 0.625rem;
    line-height: 1.25;
}

.fp-header p {
    font-size: 0.9375rem;
    color: #8D6E63;
    line-height: 1.6;
    margin: 0;
}

/* ---- Alerts ---- */

.fp-alert {
    padding: 0.875rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    animation: fpSlideDown 250ms ease-out;
}

.fp-alert-success {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #166534;
}

.fp-alert-success::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background: #16A34A;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    mask-size: 12px;
    -webkit-mask-size: 12px;
    mask-position: center;
    -webkit-mask-position: center;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
}

.fp-alert-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.fp-alert-error::before {
    content: '!';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background: #DC2626;
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

@keyframes fpSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Form ---- */

.fp-form {
    transition: opacity 200ms ease, transform 200ms ease;
}

.fp-field {
    margin-bottom: 1.5rem;
}

.fp-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4E342E;
    margin-bottom: 0.5rem;
}

.fp-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.fp-input-icon {
    position: absolute;
    left: 0.875rem;
    color: #8D6E63;
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color 200ms ease;
}

.fp-input {
    width: 100%;
    padding: 0.8125rem 1rem 0.8125rem 2.75rem;
    border: 2px solid #D7CCC8;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-family: inherit;
    color: #4E342E;
    background: #F8F5F2;
    transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
    outline: none;
}

.fp-input::placeholder {
    color: #BCAAA4;
}

.fp-input:hover {
    border-color: #BCAAA4;
}

.fp-input:focus {
    border-color: #6F4E37;
    box-shadow: 0 0 0 3px rgba(111, 78, 55, 0.12);
    background: #FFFFFF;
}

.fp-input:focus + .fp-input-icon,
.fp-input-wrapper:focus-within .fp-input-icon {
    color: #6F4E37;
}

.fp-input[aria-invalid="true"] {
    border-color: #DC2626;
    background: #FEF2F2;
}

.fp-input[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.fp-field-error {
    display: none;
    color: #DC2626;
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.fp-field-error.visible {
    display: block;
}

/* ---- Button ---- */

.fp-btn {
    width: 100%;
    padding: 0.9375rem 1.5rem;
    background: linear-gradient(135deg, #4E342E, #6F4E37);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 200ms ease, box-shadow 200ms ease, transform 150ms ease;
    box-shadow: 0 2px 8px rgba(78, 52, 46, 0.2);
}

.fp-btn:hover {
    background: linear-gradient(135deg, #3E2723, #5D4037);
    box-shadow: 0 4px 16px rgba(78, 52, 46, 0.3);
    transform: translateY(-1px);
}

.fp-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(78, 52, 46, 0.2);
}

.fp-btn:focus-visible {
    outline: 2px solid #B87333;
    outline-offset: 2px;
}

.fp-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 1px 4px rgba(78, 52, 46, 0.1);
}

.fp-btn-spinner {
    display: none;
    position: absolute;
    animation: fpSpin 700ms linear infinite;
}

@keyframes fpSpin {
    to { transform: rotate(360deg); }
}

.fp-btn.is-loading .fp-btn-text {
    visibility: hidden;
}

.fp-btn.is-loading .fp-btn-spinner {
    display: flex;
}

/* Outline variant (resend) */

.fp-btn-outline {
    background: transparent;
    color: #6F4E37;
    border: 2px solid #D7CCC8;
    box-shadow: none;
    margin-top: 0.25rem;
}

.fp-btn-outline:hover {
    background: rgba(111, 78, 55, 0.04);
    border-color: #6F4E37;
    color: #4E342E;
    box-shadow: none;
}

.fp-btn-outline:disabled {
    border-color: #D7CCC8;
    color: #BCAAA4;
    opacity: 1;
    background: transparent;
}

/* ---- Footer / Back link ---- */

.fp-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.fp-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #8D6E63;
    text-decoration: none;
    transition: color 200ms ease, gap 200ms ease;
}

.fp-back-link:hover {
    color: #4E342E;
    gap: 0.625rem;
}

.fp-back-link svg {
    transition: transform 200ms ease;
}

.fp-back-link:hover svg {
    transform: translateX(-3px);
}

.fp-back-link:focus-visible {
    outline: 2px solid #B87333;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- Success State ---- */

.fp-success {
    text-align: center;
    animation: fpFadeScale 300ms ease-out;
}

@keyframes fpFadeScale {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fp-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, #F0FDF4, #DCFCE7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #16A34A;
    box-shadow: 0 4px 16px rgba(22, 163, 74, 0.15);
}

.fp-success-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #4E342E;
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.fp-success-text {
    font-size: 0.9375rem;
    color: #8D6E63;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

.fp-success-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
}

.fp-btn-countdown {
    font-size: 0.8125rem;
    color: #BCAAA4;
    margin-left: 0.375rem;
}

/* ---- Responsive ---- */

@media (max-width: 480px) {
    .fp-card {
        padding: 2rem 1.5rem;
        border-radius: 16px;
    }

    .fp-header h1 {
        font-size: 1.375rem;
    }

    .fp-header p {
        font-size: 0.875rem;
    }

    .fp-logo svg {
        width: 44px;
        height: 44px;
    }

    .fp-input {
        padding: 0.75rem 0.875rem 0.75rem 2.5rem;
    }
}
