body {
    background: linear-gradient(135deg, #a4d8f0 0%, #15aae6 50%, #199eaf 100%);
    min-height: 100vh;
    /* font-family: 'Sarabun', 'Kanit', 'Segoe UI', Tahoma, sans-serif; */
    font-family: 'Segoe UI', 'Tahoma', 'Geneva', 'Verdana', sans-serif;
    /* หรือใช้ฟอนต์ไทยที่มีใน Windows */
    font-family: 'Leelawadee UI', 'Cordia New', 'Angsana New', sans-serif;
}
.card {
    border-radius: 1rem !important;
    box-shadow: 0 1rem 3rem rgba(0,0,0,0.15) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    background: rgba(255,255,255,0.98) !important;
    animation: slideUp 0.4s ease-out;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.form-floating > .form-control {
    border: 2px solid #e2e8f0 !important;
    border-radius: 0.75rem !important;
    padding-left: 2.75rem !important;
    transition: all 0.2s ease;
    background: #f8fafc;
}
.form-floating > .form-control:focus {
    border-color: #5bebf5 !important;
    box-shadow: 0 0 0 4px rgba(11, 143, 196, 0.15) !important;
    background: #fff;
}
.form-floating > label {
    padding-left: 2.75rem !important;
    color: #64748b;
}
.input-wrapper { position: relative; }
.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    z-index: 3;
    pointer-events: none;
    width: 1.25rem;
    height: 1.25rem;
}
.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.25rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}
.password-toggle:hover { color: #667eea; }
.btn-primary {
    background: linear-gradient(135deg, #5bb6d1, #3caed1) !important;
    border: none !important;
    border-radius: 0.75rem !important;
    padding: 0.875rem !important;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(102, 126, 234, 0.4) !important;
}
.btn-primary:active { transform: translateY(0); }
.alert {
    border-radius: 0.75rem !important;
    border: none !important;
    animation: shake 0.4s ease-in-out;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}
.progress-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.step-dot {
    width: 1.75rem; height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    background: #667eea;
    color: white;
}
.step-dot.inactive {
    background: #e2e8f0;
    color: #64748b;
}
.step-line {
    flex: 1;
    height: 3px;
    background: #e2e8f0;
    border-radius: 3px;
    max-width: 50px;
}
.step-line.active { background: #667eea; }
.footer-link {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.875rem;
}
.footer-link:hover { color: #667eea; text-decoration: none; }
.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #94a3b8;
}
.error-box { display: none; }
.error-box.show { display: block; }
@media (max-width: 576px) {
    .card { margin: 1rem !important; }
    .form-floating > .form-control { padding-left: 2.5rem !important; }
    .form-floating > label { padding-left: 2.5rem !important; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
.form-control:focus-visible,
.btn-primary:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}
.form-control.is-valid-custom {
    border-color: #10b981 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310b981' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem 1rem;
}
.form-control.is-invalid-custom {
    border-color: #ef4444 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef4444' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem 1rem;
}

/* 🔄 Preloader Styles */
#page-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #a4d8f0 0%, #15aae6 50%, #199eaf 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#page-preloader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 🌀 Spinner Animation */
.spinner-container {
    text-align: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-text {
    color: white;
    font-size: 1rem;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 🎨 Loading Dots */
.loading-dots {
    display: inline-flex;
    gap: 4px;
    margin-left: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 📋 Student Info Card Styles */
.student-info-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.info-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #cbd5e1;
    margin-bottom: 1rem;
}

.info-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: #3b82f6;
}

.info-title {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

.label-icon {
    width: 1rem;
    height: 1rem;
    color: #94a3b8;
}

.info-value {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    padding-left: 1.5rem;
    word-break: break-word;
}

.info-footer {
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px dashed #cbd5e1;
    display: flex;
    justify-content: flex-end;
}

/* 🏷️ Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.status-active,
.status-badge.status-1,
.status-badge.status-2,
.status-badge.status-3,
.status-badge.status-4,
.status-badge.status-5,
.status-badge.status-6,
.status-badge.status-7,
.status-badge.status-8,
.status-badge.status-9,
.status-badge.status-10,
.status-badge.status-11,
.status-badge.status-12,
.status-badge.status-13,
.status-badge.status-14 {
    background: #dcfce7;
    color: #166534;
}

.status-badge:not(.status-active):not(.status-1):not(.status-2):not(.status-3):not(.status-4):not(.status-5):not(.status-6):not(.status-7):not(.status-8):not(.status-9):not(.status-10):not(.status-11):not(.status-12):not(.status-13):not(.status-14) {
    background: #fef3c7;
    color: #92400e;
}

/* 📱 Responsive */
@media (min-width: 576px) {
    .info-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* 🎨 Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .student-info-card {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border-color: #334155;
    }
    .info-title { color: #f1f5f9; }
    .info-label { color: #94a3b8; }
    .info-value { color: #f8fafc; }
    .info-header { border-bottom-color: #334155; }
    .info-footer { border-top-color: #334155; }
}