/* assets/css/forgot-password.css - Coffee Theme Forgot Password Page */
/* ======================
   Global & Body
====================== */
:root {
    /* Coffee Theme Color Palette */
    --primary-brown: #6F4E37;      /* Coffee / Espresso */
    --dark-brown: #4B3D2A;         /* Deep Roast */
    --light-cream: #ECE0D1;        /* Creamy Latte */
    --beige: #DBC1AC;              /* Warm Beige */
    --accent-brown: #967259;       /* Mocha Accent */
    --text-dark: #38220F;          /* Dark Roast Text */
    --white: #FFFFFF;
    --off-white: #F9F5F0;         /* Soft Milk Foam */
    --success: #8B6F47;            /* Warm Golden Success */
    --error: #A0522D;              /* Sienna Error */
    --shadow: rgba(111, 78, 55, 0.15);
    --border: #DBC1AC;
    --input-bg: #F9F5F0;
    --hover-brown: #5A3E2E;
    --radius: 12px;
    --dev-green: #2E7D32;          /* Development green for OTP display */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'Roboto', system-ui, sans-serif;
    background: var(--light-cream);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-dark);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* Coffee Grind Pattern Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 15% 25%, rgba(150, 114, 89, 0.04) 0%, transparent 20%),
        radial-gradient(circle at 85% 75%, rgba(219, 193, 172, 0.04) 0%, transparent 20%),
        linear-gradient(45deg, transparent 49%, rgba(111, 78, 55, 0.02) 50%, transparent 51%),
        linear-gradient(-45deg, transparent 49%, rgba(139, 111, 71, 0.02) 50%, transparent 51%);
    background-size: 60px 60px;
    z-index: -1;
    pointer-events: none;
}

/* Lock scroll when modal open */
body.modal-open {
    overflow: hidden;
}

body.modal-open::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(75, 61, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1999;
}

/* ======================
   Main Container (Centered on Page)
====================== */
.signin-container {
    width: 100%;
    max-width: 420px;
    background: var(--off-white);
    padding: 40px 35px;
    border-radius: var(--radius);
    box-shadow: 
        0 12px 35px rgba(111, 78, 55, 0.18),
        0 4px 15px rgba(111, 78, 55, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    text-align: center;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(219, 193, 172, 0.4);
    backdrop-filter: blur(10px);
}

/* Coffee Bean Decorative Element */
.signin-container::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-brown), var(--primary-brown));
    clip-path: polygon(0 20%, 100% 20%, 85% 100%, 15% 100%);
    border-radius: 50% 50% 0 0;
    z-index: -1;
    box-shadow: 0 8px 20px var(--shadow);
}

@keyframes coffeeDrip {
    0%, 100% { 
        opacity: 0.3;
        height: 20px;
    }
    50% { 
        opacity: 0.8;
        height: 40px;
    }
}

/* ======================
   Page Title
====================== */
.page-title {
    margin-bottom: 30px;
    position: relative;
}

.page-title h2 {
    color: var(--primary-brown);
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 10px;
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.page-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--accent-brown), var(--success));
    border-radius: 2px;
}

.page-title p {
    color: var(--accent-brown);
    font-size: 15px;
    line-height: 1.5;
    opacity: 0.9;
    max-width: 320px;
    margin: 0 auto;
}

/* ======================
   Form Inputs
====================== */
.signin-form {
    margin-top: 20px;
}

.signin-form input {
    width: 100%;
    padding: 16px 50px 16px 18px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: var(--input-bg);
    color: var(--text-dark);
    box-shadow: inset 0 2px 4px rgba(111, 78, 55, 0.05);
}

.signin-form input::placeholder {
    color: #A08B7A;
    opacity: 0.7;
}

.signin-form input:focus {
    border-color: var(--accent-brown);
    box-shadow: 
        0 0 0 3px rgba(150, 114, 89, 0.2),
        inset 0 2px 4px rgba(111, 78, 55, 0.05);
    outline: none;
    background-color: var(--white);
}

.signin-form input:hover {
    border-color: var(--accent-brown);
}

/* ======================
   Email Icon Indicator
====================== */
.email-container {
    position: relative;
    margin-bottom: 20px;
}

.email-container::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: 0.6;
    pointer-events: none;
}

.email-container input {
    padding-left: 50px;
}

/* ======================
   Buttons
====================== */
.btn {
    width: 100%;
    padding: 16px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    margin-top: 10px;
    box-shadow: 
        0 4px 12px rgba(111, 78, 55, 0.2),
        0 2px 4px rgba(111, 78, 55, 0.1);
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s ease;
}

.btn:hover::after {
    left: 100%;
}

/* Primary Button */
.btn.primary {
    background: linear-gradient(135deg, var(--primary-brown), var(--dark-brown));
    color: var(--white);
    border: 1px solid rgba(111, 78, 55, 0.3);
}

.btn.primary:hover {
    background: linear-gradient(135deg, var(--hover-brown), var(--primary-brown));
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(111, 78, 55, 0.25),
        0 4px 8px rgba(111, 78, 55, 0.15);
}

.btn.primary:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 8px rgba(111, 78, 55, 0.2),
        0 1px 3px rgba(111, 78, 55, 0.1);
}

/* Success Button */
.btn.success {
    background: linear-gradient(135deg, var(--success), #A6895B);
    color: var(--white);
    border: 1px solid rgba(139, 111, 71, 0.3);
}

.btn.success:hover {
    background: linear-gradient(135deg, #9C7C4F, var(--success));
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(139, 111, 71, 0.25),
        0 4px 8px rgba(139, 111, 71, 0.15);
}

/* ======================
   Links
====================== */
.signin-link {
    text-align: center;
    margin-top: 25px;
    font-size: 15px;
    color: var(--accent-brown);
    padding-top: 20px;
    border-top: 1px solid rgba(219, 193, 172, 0.5);
}

.signin-link a {
    color: var(--primary-brown);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
    position: relative;
    display: inline-block;
}

.signin-link a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-brown);
    transition: width 0.3s ease;
}

.signin-link a:hover {
    color: var(--dark-brown);
    background-color: rgba(219, 193, 172, 0.1);
}

.signin-link a:hover::after {
    width: 100%;
}

/* ======================
   Toaster (Coffee Theme)
====================== */
.toaster {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    color: var(--white);
    font-weight: 600;
    z-index: 3000;
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 
        0 10px 30px rgba(111, 78, 55, 0.25),
        0 4px 15px rgba(111, 78, 55, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    max-width: 380px;
    width: 90%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.toaster::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
}

.toaster.info { 
    background: linear-gradient(135deg, var(--accent-brown), #B89A7A);
    border-left: 6px solid #8B6F47;
}

.toaster.success { 
    background: linear-gradient(135deg, var(--success), #A6895B);
    border-left: 6px solid #7D5E3A;
}

.toaster.error { 
    background: linear-gradient(135deg, var(--error), #C1734D);
    border-left: 6px solid #8B4513;
}

.toast-close {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.toast-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

@keyframes slideInRight {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

/* Toaster exit animation */
.toaster.exiting {
    animation: slideOutRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes slideOutRight {
    from { 
        transform: translateX(0); 
        opacity: 1; 
    }
    to { 
        transform: translateX(100%); 
        opacity: 0; 
    }
}

/* ======================
   Password Toggle
====================== */
.password-container {
    position: relative;
    margin-bottom: 20px;
}

.password-container .toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 8px;
    background: transparent;
    border: none;
    color: var(--accent-brown);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 20px;
}

.password-container .toggle-password:hover {
    transform: translateY(-50%) scale(1.1);
}

.password-container svg {
    width: 22px;
    height: 22px;
}

.password-container svg path,
.password-container svg circle {
    transition: 0.3s;
    stroke: currentColor;
    fill: none;
}

/* ======================
   Development OTP Display (Local Only)
====================== */
.dev-otp-display {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(139, 111, 71, 0.1), rgba(46, 125, 50, 0.1));
    border-radius: 10px;
    border: 2px dashed rgba(46, 125, 50, 0.4);
    animation: pulseDevBox 2s infinite;
}

.dev-otp-display i.fa-code {
    margin-right: 8px;
    animation: bounceDevIcon 1s infinite alternate;
}

@keyframes pulseDevBox {
    0%, 100% { border-color: rgba(46, 125, 50, 0.4); }
    50% { border-color: rgba(46, 125, 50, 0.8); }
}

@keyframes bounceDevIcon {
    0% { transform: translateY(0); }
    100% { transform: translateY(-3px); }
}

/* ======================
   OTP Modal (Coffee Theme)
====================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(75, 61, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-box {
    background: var(--off-white);
    width: 90%;
    max-width: 400px;
    border-radius: 14px;
    padding: 30px;
    box-shadow: 
        0 20px 40px rgba(111, 78, 55, 0.25),
        0 8px 20px rgba(111, 78, 55, 0.15);
    text-align: center;
    border: 1px solid rgba(219, 193, 172, 0.4);
    animation: modalSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 22px;
    color: var(--primary-brown);
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--accent-brown);
    line-height: 1;
    padding: 0;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--primary-brown);
    background-color: rgba(219, 193, 172, 0.2);
    transform: rotate(90deg);
}

/* OTP Instructions */
.modal-instructions {
    color: var(--accent-brown);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
    text-align: center;
}

/* OTP Input - Styled for Coffee Theme */
#otpInput {
    width: 100%;
    padding: 16px;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    margin: 10px 0 25px;
    background: var(--input-bg);
    color: var(--text-dark);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(111, 78, 55, 0.05);
}

#otpInput::placeholder {
    color: #A08B7A;
    font-weight: normal;
    letter-spacing: normal;
    font-size: 16px;
    opacity: 0.7;
}

#otpInput:focus {
    border-color: var(--accent-brown);
    box-shadow: 
        0 0 0 3px rgba(150, 114, 89, 0.2),
        inset 0 2px 4px rgba(111, 78, 55, 0.05);
    outline: none;
    background: var(--white);
}

/* OTP Timer */
.otp-timer {
    color: var(--accent-brown);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

/* OTP Resend Link */
.otp-resend {
    color: var(--accent-brown);
    font-size: 14px;
    margin-top: 15px;
    text-align: center;
}

.otp-resend a {
    color: var(--primary-brown);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.otp-resend a:hover {
    text-decoration: underline;
    color: var(--dark-brown);
}

.modal-actions {
    text-align: center;
}

/* ======================
   Responsive Design
====================== */

/* Tablet */
@media (max-width: 768px) {
    .signin-container {
        max-width: 380px;
        padding: 35px 30px;
    }
    
    .signin-container::before {
        top: -40px;
        width: 70px;
        height: 50px;
    }
    
    .page-title h2 {
        font-size: 26px;
    }
    
    .toaster {
        right: 15px;
        left: 15px;
        width: auto;
    }
    
    .dev-otp-display {
        padding: 12px;
        font-size: 14px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    body {
        padding: 15px;
    }
    
    .signin-container {
        padding: 30px 25px;
        margin: 20px auto;
    }
    
    .page-title h2 {
        font-size: 24px;
    }
    
    .page-title p {
        font-size: 14px;
    }
    
    .signin-form input {
        padding: 14px 45px 14px 16px;
        font-size: 15px;
    }
    
    .email-container::before {
        left: 14px;
        font-size: 16px;
    }
    
    .btn {
        padding: 14px;
        font-size: 15px;
    }
    
    .modal-box {
        padding: 25px 22px;
    }
    
    #otpInput {
        font-size: 20px;
        letter-spacing: 10px;
        padding: 14px;
    }
    
    .modal-header h3 {
        font-size: 20px;
    }
    
    .dev-otp-display {
        padding: 10px;
        margin-top: 10px;
    }
}

/* Small Mobile */
@media (max-width: 360px) {
    .signin-container {
        padding: 25px 20px;
    }
    
    .page-title h2 {
        font-size: 22px;
    }
    
    .signin-form input {
        padding: 12px 40px 12px 14px;
        font-size: 14px;
    }
    
    .btn {
        padding: 13px;
        font-size: 14px;
    }
    
    .signin-link {
        font-size: 14px;
    }
    
    #otpInput {
        font-size: 18px;
        letter-spacing: 8px;
        padding: 12px;
    }
    
    .dev-otp-display {
        font-size: 13px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .signin-form input,
    .modal-box,
    .toaster,
    .modal-close,
    .dev-otp-display {
        transition: none;
        animation: none;
    }
    
    .btn::after,
    .signin-container::after,
    .dev-otp-display {
        display: none;
    }
    
    .signin-container::after {
        animation: none;
    }
}

/* Focus visible for keyboard navigation */
.signin-form input:focus-visible,
.btn:focus-visible,
.modal-close:focus-visible,
#otpInput:focus-visible,
.signin-link a:focus-visible,
.toast-close:focus-visible {
    outline: 2px solid var(--accent-brown);
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border: #38220F;
        --shadow: rgba(56, 34, 15, 0.3);
    }
    
    .signin-container,
    .modal-box {
        border: 2px solid var(--border);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
    
    .signin-form input,
    #otpInput {
        border: 2px solid var(--border);
    }
    
    .dev-otp-display {
        border: 2px solid var(--dev-green);
    }
}

/* Print styles */
@media print {
    .signin-container,
    .modal-box {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .btn,
    .toggle-password,
    .modal-close,
    .toaster,
    .dev-otp-display {
        display: none !important;
    }
}