/*
 * หน้าเข้าสู่ระบบ — สไตล์เฉพาะหน้านี้
 * 
 *    หน้า login/verify_otp/family เป็นหน้าเดี่ยวที่ไม่ได้ใช้ assets/css/style.css
 *    (คนละธีม คนละโครง) จึงมีสไตล์ของตัวเองแยกกันคนละไฟล์
 *    แยกออกมาจาก <style> ที่เคยฝังใน login.php 265 บรรทัด
 */

:root {
    --primary: #14b8a6;
    --primary-hover: #0d9488;
    --bg-gradient: linear-gradient(135deg, #090d16 0%, #0f172a 50%, #1e1b4b 100%);
    --card-bg: rgba(15, 23, 42, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-light: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #f43f5e;
    --danger-bg: rgba(244, 63, 94, 0.1);
    --input-bg: rgba(2, 6, 23, 0.8);
    --input-border: rgba(255, 255, 255, 0.1);
    --input-focus: #14b8a6;
}

html[data-theme="light"] {
    --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(15, 23, 42, 0.08);
    --text-light: #0f172a;
    --text-muted: #475569;
    --danger: #e11d48;
    --danger-bg: rgba(225, 29, 72, 0.08);
    --input-bg: #ffffff;
    --input-border: rgba(15, 23, 42, 0.15);
    --input-focus: #0d9488;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Sarabun', 'Outfit', sans-serif;
    /* TOR 4.6.2 — ประกาศขนาดเนื้อหาหลักไว้ชัดเจน ไม่พึ่ง default ของเบราว์เซอร์
       (เหตุผลเดียวกับ assets/css/style.css) */
    font-size: 1rem;
    line-height: 1.6;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-light);
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Subtle glowing background effect - only active in dark theme */
.ambient-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.15) 0%, rgba(20, 184, 166, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

html[data-theme="light"] .ambient-glow {
    opacity: 0;
}

/* Theme toggle button styling - matches header style */
.theme-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    outline: none;
}

html[data-theme="light"] .theme-toggle-btn {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.1);
}
        
.theme-toggle-btn:hover {
    transform: scale(1.1) rotate(15deg);
    background: rgba(20, 184, 166, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 12px rgba(20, 184, 166, 0.3);
}

.login-container {
    width: 100%;
    max-width: 420px;
    z-index: 1;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.brand-section {
    text-align: center;
    margin-bottom: 24px;
}

.brand-logo {
    font-size: 3.5rem;
    margin-bottom: 8px;
    display: inline-block;
    filter: drop-shadow(0 0 12px rgba(20, 184, 166, 0.3));
}

.brand-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

.brand-tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 35px 30px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: border-color 0.3s ease, background 0.3s ease;
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px 18px;
    }
    .theme-toggle-btn {
        top: 16px;
        right: 20px;
        width: 48px;
        height: 48px;
    }
}

.login-card:hover {
    border-color: rgba(20, 184, 166, 0.25);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: center;
}

.error-message {
    background: var(--danger-bg);
    border: 1px solid rgba(244, 63, 94, 0.2);
    color: var(--danger);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.875rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.form-control {
    width: 100%;
    padding: 12px 20px; /* Increased side padding slightly for rounded look */
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 24px;
    color: var(--text-light);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    border: none;
    border-radius: 24px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.2);
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.35);
    background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 100%);
}

.btn-submit:active {
    transform: translateY(1px);
}

.footer-note {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 25px;
}
