/* ============================================================
 * ไฟล์  : assets/css/login.css
 * ระบบ  : PathoBio — หน้า Login
 * ตำแหน่ง: pathobio/assets/css/login.css
 * ============================================================
 * หน้าที่ : CSS สำหรับหน้า Login โดยเฉพาะ
 *           ใช้ร่วมกับ login.php
 *
 * CSP: ไฟล์นี้ถูกโหลดผ่าน <link rel="stylesheet"> = ครอบคลุมโดย
 *      style-src 'self' ใน Content-Security-Policy
 *      ไม่ต้องใช้ nonce
 * ============================================================ */

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Body / Background ───────────────────────────────────── */
body {
    font-family: 'Sarabun', sans-serif;
    background: linear-gradient(135deg, #0f4c81 0%, #1565c0 60%, #0d47a1 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ── Wrapper ─────────────────────────────────────────────── */
.login-wrapper {
    width: 100%;
    max-width: 440px;
}

/* ── Language Switcher ───────────────────────────────────── */
.lang-switch {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}
.lang-switch a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all 0.2s;
}
.lang-switch a:hover,
.lang-switch a.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ── Login Card ──────────────────────────────────────────── */
.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3);
    padding: 48px 40px 40px;
}

/* ── Logo Area ───────────────────────────────────────────── */
.logo-area {
    text-align: center;
    margin-bottom: 28px;
}
.logo-icon {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #0f4c81, #1565c0);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 30px;
    box-shadow: 0 8px 24px rgba(15,76,129,0.35);
}
.logo-title {
    font-size: 28px;
    font-weight: 700;
    color: #0f4c81;
    letter-spacing: 2px;
}
.logo-sub {
    font-size: 12.5px;
    color: #6b7280;
    margin-top: 5px;
    line-height: 1.5;
}

/* ── Alert Messages ──────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}
.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.attempts-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 16px;
}

/* ── Google Login Button ─────────────────────────────────── */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #374151;
    font-family: 'Sarabun', sans-serif;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-google:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.mahidol-badge {
    display: block;
    text-align: center;
    font-size: 11.5px;
    color: #6b7280;
    margin-top: 6px;
}

/* ── Divider ─────────────────────────────────────────────── */
.or-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: #9ca3af;
    font-size: 13px;
}
.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid #e5e7eb;
}

/* ── Form Elements ───────────────────────────────────────── */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-family: 'Sarabun', sans-serif;
    font-size: 15px;
    color: #111827;
    transition: border-color 0.2s;
    outline: none;
}
.form-input:focus {
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
}
.forgot-link {
    display: block;
    text-align: right;
    font-size: 13px;
    color: #1565c0;
    text-decoration: none;
    margin-top: 6px;
}
.forgot-link:hover {
    text-decoration: underline;
}

/* ── Submit Button ───────────────────────────────────────── */
.btn-primary {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #0f4c81, #1565c0);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Sarabun', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    margin-top: 8px;
}
.btn-primary:hover {
    opacity: 0.9;
}

/* ── Footer ──────────────────────────────────────────────── */
.login-footer {
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
}
.login-footer a {
    color: #6b7280;
    text-decoration: none;
}
.login-footer a:hover {
    text-decoration: underline;
}
.login-contact-btn {
    background: none;
    border: 1px solid rgba(0,0,0,0.15);
    color: #6b7280;
    font-family: 'Sarabun', sans-serif;
    font-size: 13px;
    padding: 4px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.login-contact-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

/* ── Contact Modal Overlay ───────────────────────────────── */
/* เริ่มต้น hidden — JS จะ toggle class .is-open เพื่อแสดง */
/* ไม่ใช้ style="" เพราะจะถูก CSP บล็อกใน production      */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.modal-overlay.is-open {
    display: flex;
}

/* ── Contact Modal Box ───────────────────────────────────── */
.contact-modal-box {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    padding: 24px;
    min-width: 300px;
    max-width: 420px;
    width: 90%;
}
.contact-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.contact-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}
.contact-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #9ca3af;
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
}
.contact-modal-close:hover {
    color: #1f2937;
    background: #f3f4f6;
}
.contact-modal-hr {
    border: none;
    border-top: 1px solid #f3f4f6;
    margin: 0 0 16px;
}
.contact-modal-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}
.contact-modal-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}
.contact-modal-label {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 2px;
}
.contact-modal-value {
    font-size: 15px;
    font-weight: 600;
    color: #0f4c81;
    text-decoration: none;
    word-break: break-all;
}
.contact-modal-value:hover {
    text-decoration: underline;
}
.contact-modal-btn {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 10px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    font-family: 'Sarabun', sans-serif;
}
.contact-modal-btn:hover {
    background: #e5e7eb;
}
