/* ==========================================
   CSS สำหรับ Login Widget
   (นักพัฒนาธีมสามารถปรับแก้ได้อิสระ)
========================================== */

/* 1. กรณีล็อกอินแล้ว */
.login-widget-logged-in {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    font-size: 0.9rem;
}
.login-widget-logged-in .user-name { color: #334155; }
.login-widget-logged-in .btn-system { color: #2563eb; text-decoration: none; font-weight: 600; }
.login-widget-logged-in .divider { color: #cbd5e1; }
.login-widget-logged-in .btn-logout { color: #ef4444; text-decoration: none; }

/* 2. กล่องฟอร์มล็อกอิน */
.login-widget-form-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 30px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}
.login-widget-form-container h3 {
    margin: 0 0 20px 0;
    text-align: center;
    color: #0f172a;
    font-size: 1.4rem;
}

/* 3. โครงสร้างช่องกรอกข้อมูล (Inputs) */
.login-form .form-group { margin-bottom: 16px; }
.login-form label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.9rem; color: #334155; }
.login-form .input-wrapper { position: relative; display: flex; align-items: center; }
.login-form .input-icon { position: absolute; left: 12px; color: #94a3b8; font-size: 1.1rem; }
.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 10px 40px 10px 38px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
    border-color: #2563eb;
}

/* ปุ่มดูรหัสผ่าน (สลับ active) */
.btn-toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 1.2rem;
    padding: 0;
}
.btn-toggle-password.active { color: #2563eb; }

/* 4. ลิงก์ใต้ฟอร์ม & ปุ่ม Submit */
.login-form .form-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.85rem;
}
.form-links .link-forgot { color: #64748b; text-decoration: none; }
.form-links .link-register { color: #2563eb; text-decoration: none; font-weight: 600; }
.login-form .btn-submit {
    width: 100%;
    padding: 11px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.login-form .btn-submit:hover { background: #1d4ed8; }

/* 5. เส้นคั่น หรือ */
.social-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0 18px 0;
}
.social-divider .line { flex: 1; border-bottom: 1px solid #e2e8f0; }
.social-divider span { padding: 0 10px; color: #64748b; font-size: 0.85rem; }

/* 6. ปุ่ม Social & Animation Tooltip */
.widget-social-auth {
    display: flex;
    justify-content: center;
    gap: 12px;
    align-items: center;
    margin-top: 10px;
}
.widget-social-auth.social-only { margin-top: 0; }
.widget-social-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}
.widget-social-btn.btn-google { background: #ffffff; border: 1px solid #e2e8f0; }
.widget-social-btn.btn-line { background: #06C755; }
.widget-social-btn.btn-facebook { background: #1877F2; }
.widget-social-btn:hover {
    transform: translateY(-6px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* Tooltip กล่องดำ */
.widget-social-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background-color: #1e293b;
    color: #ffffff;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    z-index: 10;
}
/* ลูกศร Tooltip */
.widget-social-btn::before {
    content: '';
    position: absolute;
    bottom: calc(115% - 5px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: none;
    z-index: 10;
}
.widget-social-btn:hover::after,
.widget-social-btn:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}