/* test/auth.css (ฉบับสมบูรณ์) */

/* === Modal Styles (โค้ดเดิม) === */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.auth-modal-overlay.show .login-modal {
    transform: scale(1);
}

.login-modal {
    background: var(--background, #FDFCF9);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.login-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #EDEAE6);
}

.login-modal-title {
    font-size: 1.2rem;
    color: var(--secondary, #3A322B);
}

.login-modal-body {
    padding: 1.5rem;
}

.login-modal-subtitle {
    text-align: center;
    color: var(--muted-text, #8A8177);
    margin-bottom: 1.5rem;
}

.social-login-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.social-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-family: 'Kanit', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.social-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.social-btn i { font-size: 1.2rem; }
.line-btn { background: #00B900; color: white; }
.facebook-btn { background: #1877F2; color: white; }
.google-btn { background: #FFFFFF; color: #444; border: 1px solid #ddd; }
.tiktok-btn { background: #000000; color: white; }
.apple-btn { background: #1A1A1A; color: white; }


/* === [โค้ดที่หายไป] สไตล์สำหรับปุ่มโปรไฟล์ === */

/* จัดสไตล์ให้ div หลัก (.user-profile) ดูเหมือนปุ่ม */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 50px; /* ทำให้ขอบมนสวยงาม */
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    background-color: transparent; /* ตั้งเป็นโปร่งใส */
    width: 100%;
    justify-content: center; /* จัดให้อยู่กลางแนวนอน */
    border: var(--leaf-border-width, 2px) solid var(--leaf-border, #CDECCF); /* ขอบเป็นสีเขียวพาสเทลใบตอง ความหนา 2px */
}

/* เพิ่มเอฟเฟกต์เมื่อเอาเมาส์ไปชี้ — ใช้สีครึ่งโปร่งใสถ้าต้องการไฮไลท์ */
.user-profile:hover {
    background-color: rgba(205, 236, 207, 0.12); /* ไฮไลท์สีเขียวพาสเทลอ่อน */
    box-shadow: 0 2px 8px rgba(98, 158, 106, 0.08);
    border: var(--leaf-border-width, 2px) solid var(--leaf-border, #CDECCF);
}

/* จัดการขนาดและสีของรูปโปรไฟล์ (หรือไอคอน) */
.user-profile .profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: var(--profile-pic-border-width, 1px) solid var(--border-color, #eee);
}

/* จัดสไตล์ชื่อและแต้ม */
.user-profile .profile-name {
    font-weight: 500;
    color: var(--text-color, #333);
    font-size: 1rem;
}

/* สไตล์สำหรับ Badge แสดงแต้ม */
.points-badge {
    background-color: var(--primary-light, #FFF4E3);
    color: var(--primary, #FFA500);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 5px;
}
.welcome-message {
    color: var(--secondary, #3A322B);
    font-weight: 500;
    margin-top: 1rem;
    display: none; /* ซ่อนไว้ก่อน */
    text-align: center;
}

.profile-button-container {
    padding: 0 16px;
    margin-bottom: 16px;
}

#loginProfileBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    background-color: #ffffff;
    color: #3A322B;
    font-family: 'Kanit', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#loginProfileBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

#loginProfileBtn .fa-user-circle {
    font-size: 1.2rem;
    color: var(--primary, #FFA500);
}

/* === NEW: Phone Auth Trigger Style === */
/* กำหนดสีน้ำเงินสำหรับปุ่มเข้าสู่ระบบ/ลงทะเบียนด้วยเบอร์โทรศัพท์ */
.phone-auth-trigger-btn {
    background-color: #3498db !important; /* สีน้ำเงิน */
    color: white !important;
    border: none !important;
    /* เพิ่มสไตล์พื้นฐานเพื่อให้แน่ใจว่ามันเป็น Flex Container */
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* NEW: สไตล์สำหรับชื่อฟอร์มใน Modal ย่อย */
.login-modal-body h4 {
    color: #3A322B;
}

/* NEW: ปรับสไตล์ Input ใน Modal ย่อยให้ทนทาน */
.login-modal-body .input-group input[type="tel"],
.login-modal-body .input-group input[type="password"],
.login-modal-body .input-group .social-btn {
    font-size: 1rem;
    padding: 12px;
}

/* === NEW: Phone Auth Container Styles for Multi-View Flow === */

/* สไตล์สำหรับ Container หลักของฟอร์ม (Login/Register/Forgot) */
#phoneLoginContainer {
    padding: 10px 0 0 0; /* ลด padding ด้านบน/ล่าง เพราะ Modal Body มีอยู่แล้ว */
}

/* ปรับสไตล์ Input ใน Phone Views ให้มีขนาดเท่ากับปุ่ม Social */
#phoneLoginContainer input[type="tel"],
#phoneLoginContainer input[type="password"],
#phoneLoginContainer input[type="email"] {
    width: 100%;
    padding: 12px 15px; /* เพิ่ม padding ให้เท่ากับปุ่ม social-btn */
    border: 1px solid var(--border-color, #ccc);
    border-radius: 12px; /* ใช้ border-radius เดียวกับ social-btn */
    box-sizing: border-box;
    font-size: 1rem;
    font-family: 'Kanit', sans-serif;
}

/* สไตล์สำหรับปุ่ม Link (ลงทะเบียน / ลืมรหัสผ่าน) */
.phone-view .auth-link-btn {
    flex: 1; /* ทำให้ปุ่มแบ่งพื้นที่เท่ากัน */
    text-align: center;
    padding: 10px 0;
    border-radius: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.2s;
    font-size: 0.95rem;
}

/* สไตล์เฉพาะปุ่มลงทะเบียน (กรอบเขียว) */
#linkToRegister {
    border: 1px solid #00B900;
    color: #00B900;
}

/* สไตล์เฉพาะปุ่มลืมรหัสผ่าน (กรอบแดง) */
#linkToForgotPassword,
#forgotPasswordSubmitBtn {
    border: 1px solid var(--error-admin, #e74c3c);
    color: var(--error-admin, #e74c3c);
}

/* สไตล์สำหรับปุ่ม Submit หลัก (เข้าสู่ระบบ) */
#phoneLoginSubmitBtn,
#registerSubmitBtn {
    /* ใช้สีเดียวกับ Facebook/Blue Button ที่ดูคุ้นเคย */
    background-color: #1877F2 !important;
    color: white !important;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3); /* เพิ่มเงาให้ดูเด่น */
}