@import url('https://fonts.googleapis.com/css2?family=Kanit:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

body {
      font-family: "Kanit", sans-serif;
    background: linear-gradient(135deg, #FBAF2B 0%, #FFD700 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    max-width: 900px;
    display: flex;
    min-height: 600px;
}

.login-image {
    flex: 1;
    background: linear-gradient(135deg, #FBAF2B 0%, #FFD700 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
}

.login-image-content {
    text-align: center;
    color: white;
    position: relative;
    z-index: 1;
    padding: 40px;
}

.login-image-content i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.login-image-content h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.login-image-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
}

.login-form {
    flex: 1;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    color: #2c3e50;
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    margin-bottom: 10px;
}

.login-header p {
    color: #666;
    font-size: 1rem;
}

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

.form-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-group {
    position: relative;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 1.1rem;
}

/* แก้ input ให้ยืดเต็ม */
.form-control {
    width: 100%; /* เดิม fix 300px */
    max-width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: #f8f9fa;
    box-sizing: border-box; /* ป้องกันล้น */
}

.form-control:focus {
    border-color: #FBAF2B;
    background: white;
    box-shadow: 0 0 0 3px rgba(251, 175, 43, 0.1);
}

.form-control.error {
    border-color: #e74c3c;
}

.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #FBAF2B;
}

.checkbox-group label {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.forgot-password {
    color: #FBAF2B;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

.btn-login {
    font-family: kanit, sans-serif;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #FFD700 0%, #FBAF2B 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(251, 175, 43, 0.3);
}

.btn-login:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.divider {
    text-align: center;
    margin: 30px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
}

.divider span {
    background: white;
    padding: 0 20px;
    color: #666;
    font-size: 0.9rem;
}

.social-login {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.btn-social {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: white;
    color: #333;
    text-decoration: none;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-social:hover {
    border-color: #FBAF2B;
    background: #f8f9fa;
}

.btn-social i {
    font-size: 1.2rem;
}

.btn-google i {
    color: #DB4437;
}

.btn-facebook i {
    color: #4267B2;
}

.login-footer {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.login-footer a {
    color: #FBAF2B;
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

.back-to-website {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-to-website:hover {
    transform: translateX(-5px);
}

/* Loading animation */
.loading {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ปรับ login-container บนจอเล็ก */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        min-height: auto;
        padding: 20px;
        box-shadow: none;
        border-radius: 0;
    }

    .login-form {
        padding: 20px;
        width: 80%;
        font-size: 12px;
    }

    .form-group {
        width: 100%;
    }

    .social-login {
        flex-direction: column;
        gap: 10px;
    }

    .btn-login {
        width: 100%;
    }
}
/* Responsive Mobile */
@media (max-width: 480px) {
    body {
        padding: 8px;
        font-size: 12px; /* เพิ่มให้ตัวอักษรอ่านง่ายบนจอเล็ก */
    }

    .login-container {
        max-width: 100%;
        border-radius: 10px;
        min-height: auto;
        padding: 15px; /* เพิ่ม padding ให้กล่องดูสบายตา */
    }
        .login-form {
        padding: 20px;
        width: 80%;
    }
    .btn-login {
        font-size: 10px; /* เพิ่มให้ตัวอักษรอ่านง่ายบนจอเล็ก */
        padding: 12px;
        width: 100%; /* ปุ่มกว้างเต็มหน้าจอ */
    }

    .social-login {
        gap: 8px;
        flex-direction: column; /* ปรับให้เรียงปุ่ม social login ลงล่างแทนแนวนอน */
    }
}

/* Success animation */
.success-animation {
    display: none;
    text-align: center;
    color: #27ae60;
}

.success-animation i {
    font-size: 3rem;
    margin-bottom: 15px;
}

.success-animation h3 {
    margin-bottom: 10px;
}
