/* ================================================
  BASE & LAYOUT STYLES (ใช้ร่วมกัน: body, .login-page)
  ================================================ */

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
    background: radial-gradient(circle at top, #e0f2ff, #f5f5f5 40%, #eef2ff);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-page {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Login/Signup Card Container (.login-card) */
.login-card {
    width: 100%;
    max-width: 420px;


    position: relative; /* ฐานสำหรับ language-switcher */
}

/* ================================================
  LANGUAGE SWITCHER STYLES (ใช้ร่วมกัน)
  ================================================ */

.language-switcher {
    position: absolute;
    top: 12px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
}

.lang-btn {
    border: none;
    background: transparent;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
}

.lang-btn:hover {
    background: rgba(148, 163, 184, 0.12);
}

.lang-btn.active {
    background: #4f46e5;
    color: #ffffff;
}

.lang-separator {
    color: #cbd5e1;
    font-size: 0.7rem;
}

/* ================================================
  FORM ELEMENTS & TYPOGRAPHY (ใช้ .login-card เป็นฐาน)
  ================================================ */

/* Logo styling */
.login-card img {
    filter: drop-shadow(0 6px 12px rgba(15, 23, 42, 0.25));
}

/* Form spacing */
.login-card .mb-3 {
    margin-bottom: 1rem !important;
}

/* Form labels */
.login-card .form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #0f172a;
    margin-bottom: 0.35rem;
}

/* Password Hint Text (ใช้สำหรับ Sign Up) */
.login-card small.text-muted {
    font-size: 0.78rem;
    color: #6b7280 !important;
}

/* Input group icons */
.login-card .input-group-text {
    background: #eef2ff;
    border-color: #e5e7eb;
    border-right: none; 
    color: #4f46e5;
}

.login-card .input-group-text i {
    font-size: 1rem;
}

/* Form controls */
.login-card .form-control {
    border-color: #e5e7eb;
    border-left: none; /* เพื่อให้ติดกับ input-group-text */
    box-shadow: none;
    font-size: 0.9rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.login-card .form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 0.15rem rgba(79, 70, 229, 0.18);
}

/* Remember me checkbox (ใช้สำหรับ Login) */
.login-card .form-check-label {
    font-size: 0.86rem;
    color: #6b7280;
}

/* Primary button */
.login-card .btn-primary {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    border: none;
    border-radius: 9px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-card .btn-primary:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
}

/* Links (Forgot password / Sign Up) */
.login-card a.text-muted {
    font-size: 0.86rem;
    text-decoration: none;
    color: #6b7280;
}

.login-card a.text-muted:hover {
    text-decoration: underline;
    color: #4f46e5;
}

/* Divider (ใช้สำหรับ Login) */
.login-card hr {
    margin-top: 20px;
    margin-bottom: 18px;
}

/* Header & Text Centering */
.login-card .text-center {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-card .text-center h4 {
    margin-top: 1rem;
    color: #0f172a;
    font-weight: 600;
}

/* "Don't have account?" / "Already have account?" section */
.login-card .mt-4.text-center {
    margin-top: 1.5rem;
    text-align: center;
}

.login-card .mt-4.text-center p {
    font-size: 0.86rem;
    color: #6b7280 !important;
    margin-bottom: 0;
}

/* ================================================
  LOADING OVERLAY & SWEETALERT (ใช้ร่วมกัน)
  ================================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1050;
}

.loading-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.spinner-wrapper {
    text-align: center;
    color: #e5e7eb;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
}

.loading-logo {
    width: 80px;
    height: auto;
    border-radius: 16px;
    box-shadow:
        0 15px 25px rgba(15, 23, 42, 0.55),
        0 0 0 1px rgba(148, 163, 184, 0.35);
}

.spinner-ring {
    position: absolute;
    inset: -10px;
    border-radius: 999px;
    border: 3px solid rgba(148, 163, 184, 0.4);
    border-top-color: #38bdf8;
    border-right-color: #22c55e;
    border-bottom-color: #f97316;
    animation: spinner 1s linear infinite;
}

.loading-text {
    margin-top: 4px;
    font-size: 0.85rem;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

.swal2-popup {
    border-radius: 16px !important;
    font-family: inherit !important;
}

/* ================================================
  RESPONSIVE DESIGN (ใช้ร่วมกัน)
  ================================================ */

@media (max-width: 480px) {
    body {
        padding: 16px;
    }

    .login-card {
 
        max-width: 360px;
    }

    .login-card .text-center h4 {
        font-size: 1.1rem;
    }
}



.d-grid {
    display: grid;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-3 {
    margin-top: 1rem;
}






.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90vh;
}

/* Auth Card Container */
.auth-card {
  width: 100%;
  max-width: 420px;

  position: relative;
}

/* Header Text Color (สีม่วงเข้ม) */
.auth-card h4 {
    color: #4f46e5; 
}

/* Button Primary Style (.btn-primary) ให้เป็นสีม่วง Gradient */
.auth-card .btn-primary {
    /* ใช้ !important เพื่อให้แน่ใจว่า Override Bootstrap */
  
    border: none !important;
    border-radius: 1px;
    font-weight: 600;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-card .btn-primary:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5) !important;
}

/* สไตล์ Input Group Icons และ Input fields ให้เข้า Theme */
.auth-card .input-group-text {

    border-color: #e5e7eb;
    color: #4f46e5 !important;
    border-right: none;
}

.auth-card .form-control {
    border-left: none;
    box-shadow: none;
}
.auth-card .form-control:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 0.15rem rgba(79, 70, 229, 0.18);
}
