@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600&display=swap');

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Kanit', sans-serif; 
}

body { 
    height: 100vh; 
    overflow: hidden; 
}

.login-container { 
    display: flex; 
    height: 100%; 
    width: 100%; 
}

/* --- Left Side Design --- */
.login-left {
    flex: 1;
    background-color: #1A2238;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px;
    color: white;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

.brand-logo { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    font-size: 1.5rem; 
    font-weight: 500; 
    color: #F89b42; 
}

.logo-icon { 
    width: 35px; 
    height: 35px; 
    stroke: #F89b42; 
    stroke-width: 2.5; 
    fill: none; 
    stroke-linecap: round; 
    stroke-linejoin: round; 
}

.visual-container { 
    position: absolute; 
    top: 50%; left: 50%; 
    transform: translate(-50%, -60%); 
    width: 300px; 
    height: 300px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
}

.circle-outer { 
    position: absolute; 
    width: 100%; 
    height: 100%; 
    border: 1px solid #F89b42; 
    border-radius: 50%; 
    opacity: 0.8; 
}

.circle-inner { 
    position: absolute; 
    width: 75%; 
    height: 75%; 
    border: 2px dashed #F89b42; 
    border-radius: 50%; 
    opacity: 0.6; 
}

.energy-icon { 
    font-size: 80px; 
    color: #F89b42; 
    z-index: 2; 
}

.left-content { 
    margin-bottom: 40px; 
    z-index: 2; 
}

.left-content h2 { 
    font-size: 2rem; 
    line-height: 1.2; 
    font-weight: 500; 
}

.left-content .highlight { 
    color: #F89b42; 
    margin-bottom: 15px; 
    display: block; 
}

.left-content p { 
    color: #8fa1b8; 
    font-weight: 300; 
    max-width: 400px; 
    font-size: 0.95rem; 
}

/* --- Right Side Sign In --- */
.login-right {
    flex: 1;
    background-color: #F2F2F2;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

.form-wrapper {
    width: 100%;
    max-width: 420px;
    max-height: 100vh; 
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: thin;
}

.form-wrapper h1 {
    font-size: 1.8rem;
    color: #1a1a1a;
    font-weight: 500;
    margin-bottom: 5px;
}

.subtitle {
    color: #666;
    margin-bottom: 15px;
    font-weight: 300;
    font-size: 0.9rem;
}

form label {
    display: block;
    color: #333;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 0.85rem;
}

.input-group {
    position: relative;
    margin-bottom: 10px;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 8px 12px 8px 35px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border 0.2s;
}

.input-group input:focus { 
    border-color: #F89b42;
    background-color: #fff;
}

.address-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.address-field { 
    display: flex; 
    flex-direction: column; 
    position: relative;
}

.address-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    background-color: #f9f9f9;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Button and Links */
.btn-login {
    width: 100%;
    padding: 10px;
    background: #F89b42;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    margin-bottom: 10px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(248, 155, 66, 0.4);
}

.signup-links {
    margin-top: 20px;
}

.signup-links p {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 8px;
}

.signup-links a {
    color: #F89b42; 
    text-decoration: none;
    transition: opacity 0.2s;
}

.signup-links a:hover {
    opacity: 0.8;
}

.role-admin {
    color: #1A2238; 
    font-weight: 700;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    cursor: pointer;
    font-size: 1rem;
    z-index: 10;
}

.password-toggle:hover {
    color: #F89b42;
}

/* Input Error Design */
input.input-error {
    border: 1px solid #ff3333 !important;
    background-color: #fffafa !important;
}

.error-message {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background-color: #ff3333;
    color: white;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 100;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    pointer-events: none;
    opacity: 0;
    transform: translateY(-5px);
    animation: floatIn 0.2s forwards ease-out;
}

.error-message::before {
    content: "";
    position: absolute;
    top: -4px;
    left: 10px;
    border-width: 0 4px 4px 4px;
    border-style: solid;
    border-color: transparent transparent #ff3333 transparent;
}

@keyframes floatIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    font-size: 1.8rem;
    color: #888;
    text-decoration: none;
    z-index: 100;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    color: #F89b42;
    background-color: rgba(0,0,0,0.05);
    transform: rotate(90deg);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    margin-bottom: 10px;
}

.btn-back {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #666;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-back:hover {
    border-color: #F89b42;
    color: #F89b42;
    background-color: #fff5eb;
}

.button-group .btn-login {
    flex: 2;
    margin: 0;
}

.mobile-logo {
    display: none;
    align-items: center;
    gap: 10px;
    color: #1A2238; 
    font-size: 1.4rem;
    font-weight: 500;
    z-index: 100;
}

.logo-icon-mobile {
    width: 35px;
    height: 35px;
    stroke: #F89b42;
    stroke-width: 2.5;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mobile-divider {
    display: none;
}

@media (max-width: 900px) {
    
    body {
        overflow-y: auto; 
        height: auto;
        min-height: 100vh;
    }

    .login-container {
        flex-direction: column;
    }

    .login-left {
        display: none;
    }

    .login-right {
        padding: 80px 20px 30px; 
        min-height: 100vh;
        align-items: center; 
        position: relative;
    }

	.mobile-divider {
        display: block;
        position: absolute;
        top: 80px; 
        left: 0;
        width: 100%;
        height: 1px;
        background-color: #d1d5db;
        z-index: 90;
    } 
	
    .mobile-logo {
        display: flex;
        position: absolute;
        top: 25px;
        left: 25px;
    }

    .close-btn {
        top: 25px;
        right: 25px;
    }

    .form-wrapper {
        width: 100%;
        max-width: 100%;
        max-height: none; 
        overflow-y: visible; 
        padding-right: 0;
		padding-top: 20px;
    }

    .form-wrapper h1 {
        font-size: 1.5rem;
        text-align: center;
        margin-top: 10px;
    }

    .subtitle {
        text-align: center;
    }

    .signup-links {
        padding-bottom: 20px;
    }
}