/* ========================================
 * FORGOT PASSWORD PAGE STYLES - โทนสีใหม่ตามภาพ
 * ใช้โทนสีไล่จากเขียวเข้มไปเขียวอ่อนและเหลืองครีม
 * ======================================== */

:root {
    /* โทนสีใหม่ตามภาพ - gradient จากเขียวเข้มไปเขียวอ่อนและเหลืองครีม */
    --teal-deep: #5fb3b3;      /* สีเขียวเข้ม (บนสุด) */
    --mint-medium: #88c999;     /* สีเขียวกลาง */
    --mint-light: #b8e6c1;      /* สีเขียวอ่อน */
    --cream-yellow: #f0e6a6;    /* สีเหลืองครีม (ล่างสุด) */
    
    /* สีหลักของระบบ */
    --primary-color: var(--teal-deep);
    --primary-light: var(--mint-medium);
    --primary-dark: #4a9999;
    
    /* Gradient Background ตามภาพ */
    --gradient-bg: linear-gradient(180deg, 
        var(--teal-deep) 0%, 
        var(--mint-medium) 33%, 
        var(--mint-light) 66%, 
        var(--cream-yellow) 100%);
        
    /* Secondary Colors */
    --success-color: var(--mint-medium);
    --warning-color: #f4d03f;
    --danger-color: #e74c3c;
    --info-color: var(--mint-light);
    
    /* Text Colors */
    --text-color: #2d3748;
    --text-muted: #718096;
}

/* ========================================
 * BODY BACKGROUND
 * ======================================== */

body {
    font-family: 'Noto Sans Thai', 'Sarabun', sans-serif;
    background: var(--gradient-bg);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
}

/* ========================================
 * ANIMATED BACKGROUND ELEMENTS
 * ======================================== */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 20% 30%, rgba(95, 179, 179, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(136, 201, 153, 0.1) 0%, transparent 45%),
        radial-gradient(circle at 60% 20%, rgba(184, 230, 193, 0.08) 0%, transparent 35%),
        radial-gradient(circle at 30% 80%, rgba(240, 230, 166, 0.06) 0%, transparent 50%);
    animation: backgroundFloat 15s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(95, 179, 179, 0.03) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 40%, rgba(136, 201, 153, 0.02) 60%, transparent 80%);
    animation: backgroundShift 20s ease-in-out infinite reverse;
}

@keyframes backgroundFloat {
    0%, 100% { opacity: 0.8; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-10px); }
}

@keyframes backgroundShift {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.9; }
}

/* ========================================
 * MAIN CONTAINER STYLING
 * ======================================== */

.container {
    position: relative;
    z-index: 1;
}

/* ========================================
 * CARD STYLING - ปรับให้เข้ากับโทนสีใหม่
 * ======================================== */

.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(95, 179, 179, 0.2);
    border-radius: 1.5rem;
    box-shadow: 
        0 20px 40px rgba(95, 179, 179, 0.15),
        0 10px 25px rgba(136, 201, 153, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--teal-deep) 0%, 
        var(--mint-medium) 50%, 
        var(--mint-light) 100%);
    animation: topBorderShine 3s ease-in-out infinite;
}

@keyframes topBorderShine {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 25px 50px rgba(95, 179, 179, 0.2),
        0 15px 30px rgba(136, 201, 153, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

/* ========================================
 * CARD HEADER - ใช้ gradient ตามโทนสีใหม่
 * ======================================== */

.card-header {
    background: linear-gradient(135deg, var(--teal-deep) 0%, var(--mint-medium) 100%) !important;
    border-bottom: none;
    color: white !important;
    padding: 2rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: headerShine 4s ease-in-out infinite;
}

@keyframes headerShine {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: -100%; }
}

.card-header h4 {
    margin: 0;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.card-header h4::before {
    content: '🔐';
    font-size: 1.2em;
    margin-right: 0.5rem;
}

/* ========================================
 * STEP INDICATORS
 * ======================================== */

.step-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    margin: -1rem -1rem 1rem -1rem;
    border-bottom: 1px solid rgba(95, 179, 179, 0.1);
}

.step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #64748b;
    font-weight: 600;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.step.active {
    background: linear-gradient(135deg, var(--teal-deep) 0%, var(--mint-medium) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(95, 179, 179, 0.3);
}

.step.completed {
    background: var(--success-color);
    color: white;
}

.step.completed::after {
    content: '✓';
    font-size: 0.9rem;
}

.step:not(:last-child)::before {
    content: '';
    position: absolute;
    right: -25px;
    width: 30px;
    height: 2px;
    background: #e2e8f0;
    z-index: -1;
}

.step.completed:not(:last-child)::before {
    background: var(--success-color);
}

/* ========================================
 * FORM STYLING - อัปเดตสีใหม่
 * ======================================== */

.form-label {
    color: var(--teal-deep);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label .text-danger {
    color: var(--danger-color) !important;
}

/* ========================================
 * INPUT GROUP STYLING
 * ======================================== */

.input-group-text {
    background: linear-gradient(135deg, var(--teal-deep) 0%, var(--mint-medium) 100%);
    color: white;
    border: 1px solid var(--teal-deep);
    border-right: none;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 50px;
    justify-content: center;
}

.input-group .form-control {
    border-left: none;
    border-color: var(--teal-deep);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1rem;
}

.input-group .form-control:focus {
    border-color: var(--mint-medium);
    box-shadow: 0 0 0 0.2rem rgba(95, 179, 179, 0.25);
    background: white;
    z-index: 3;
}

.input-group:focus-within .input-group-text {
    background: linear-gradient(135deg, var(--mint-medium) 0%, var(--mint-light) 100%);
    border-color: var(--mint-medium);
}

/* สำหรับ toggle password button */
.input-group .btn-outline-secondary {
    border-left: none;
    border-color: var(--teal-deep);
    color: var(--teal-deep);
    background: white;
    transition: all 0.3s ease;
}

.input-group .btn-outline-secondary:hover {
    background: var(--mint-light);
    color: var(--teal-deep);
    border-color: var(--mint-medium);
    transform: scale(1.05);
}

.input-group .btn-outline-secondary:focus {
    box-shadow: 0 0 0 0.2rem rgba(95, 179, 179, 0.25);
}

/* ========================================
 * BUTTON STYLING - โทนสีใหม่
 * ======================================== */

.btn-primary {
    background: linear-gradient(135deg, var(--teal-deep) 0%, var(--mint-medium) 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: none;
}

.btn-primary::before {
    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.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--teal-deep) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(95, 179, 179, 0.3);
}

.btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--teal-deep) 100%);
    color: white;
    box-shadow: 0 0 0 0.2rem rgba(95, 179, 179, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

/* ========================================
 * ALERT STYLING - อัปเดตสีตามโทน
 * ======================================== */

.alert {
    border-radius: 0.75rem;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
}

.alert-danger {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1) 0%, rgba(231, 76, 60, 0.05) 100%);
    color: #c0392b;
    border-left: 4px solid var(--danger-color);
}

.alert-success {
    background: linear-gradient(135deg, rgba(136, 201, 153, 0.1) 0%, rgba(184, 230, 193, 0.05) 100%);
    color: var(--teal-deep);
    border-left: 4px solid var(--success-color);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(240, 230, 166, 0.1) 0%, rgba(240, 230, 166, 0.05) 100%);
    color: #b8860b;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(184, 230, 193, 0.1) 0%, rgba(184, 230, 193, 0.05) 100%);
    color: var(--teal-deep);
    border-left: 4px solid var(--info-color);
}

.alert ul {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.alert li {
    margin-bottom: 0.25rem;
}

/* ========================================
 * SUCCESS STATE STYLING
 * ======================================== */

.success-icon {
    color: var(--success-color);
    animation: successPulse 2s ease-in-out;
}

@keyframes successPulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.success-content h5 {
    color: var(--teal-deep);
    font-weight: 600;
    margin-bottom: 1rem;
}

.success-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ========================================
 * CARD FOOTER
 * ======================================== */

.card-footer {
    background: rgba(248, 249, 250, 0.9);
    border-top: 1px solid rgba(95, 179, 179, 0.1);
    padding: 1.25rem;
    text-align: center;
}

.card-footer p {
    margin: 0;
    color: var(--text-muted);
}

.card-footer a {
    color: var(--teal-deep);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.card-footer a:hover {
    color: var(--mint-medium);
    text-decoration: underline;
}

/* ========================================
 * FORM TEXT AND HELP TEXT
 * ======================================== */

.form-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    line-height: 1.4;
}

/* ========================================
 * STEP CONTENT ANIMATIONS
 * ======================================== */

.step-content {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
 * NAVBAR OVERRIDE สำหรับหน้านี้
 * ======================================== */

.navbar-dark {
    background: linear-gradient(135deg, var(--teal-deep) 0%, var(--mint-medium) 50%, var(--mint-light) 100%) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(95, 179, 179, 0.2);
    box-shadow: 0 2px 15px rgba(95, 179, 179, 0.15);
}

/* ========================================
 * LOADING STATES
 * ======================================== */

.btn-loading {
    position: relative;
    overflow: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: buttonLoading 2s infinite;
}

@keyframes buttonLoading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ========================================
 * RESPONSIVE DESIGN
 * ======================================== */

@media (max-width: 768px) {
    .card {
        margin: 1rem;
        border-radius: 1rem;
    }
    
    .card-header {
        padding: 1.5rem 1rem;
    }
    
    .card-body {
        padding: 1.5rem 1rem;
    }
    
    .btn-primary {
        padding: 0.875rem 1.5rem;
    }
    
    .step-indicator {
        margin: -1rem -1rem 1rem -1rem;
        padding: 0.75rem;
    }
    
    .step {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0.5rem;
    }
    
    .card {
        margin: 0.5rem;
        border-radius: 0.75rem;
    }
    
    .card-header h4 {
        font-size: 1.25rem;
    }
    
    .btn-lg {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    .step-indicator {
        display: none; /* ซ่อน step indicator ในหน้าจอเล็ก */
    }
}

/* ========================================
 * ACCESSIBILITY ENHANCEMENTS
 * ======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.visually-hidden-focusable:focus {
    background: var(--teal-deep);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
}

/* ========================================
 * HIGH CONTRAST MODE SUPPORT
 * ======================================== */

@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--teal-deep);
        background: white;
    }
    
    .card-header {
        background: var(--teal-deep) !important;
        color: white !important;
    }
    
    .form-label {
        color: #000;
        font-weight: bold;
    }
    
    .btn-primary {
        background: var(--teal-deep) !important;
        border: 2px solid white;
    }
    
    .btn-primary:hover {
        background: white !important;
        color: var(--teal-deep) !important;
        border: 2px solid var(--teal-deep);
    }
    
    .alert {
        border: 2px solid currentColor;
    }
}

/* ========================================
 * FOCUS STYLES
 * ======================================== */

.form-control:focus,
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(95, 179, 179, 0.25);
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--teal-deep);
    outline-offset: 2px;
}

/* ========================================
 * PRINT STYLES
 * ======================================== */

@media print {
    body {
        background: white !important;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
        background: white;
        break-inside: avoid;
    }
    
    .card-header {
        background: #f8f9fa !important;
        color: #000 !important;
    }
    
    .btn {
        display: none;
    }
    
    .navbar,
    .footer {
        display: none;
    }
}