/* Glassmorphism -> White theme with centered card on background image */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --login-panel-width: min(430px, 36vw);
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #fff;
    min-height: 100vh;
    display: block;
    padding: 0;
    color: #111;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('https://cadvietarchitects.com/wp-content/uploads/2026/04/ChatGPT-Image-23_15_03-16-thg-4-2026-2.png');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    filter: blur(8px);
    opacity: 0.34;
    transform: scale(1.03);
    z-index: 0;
    pointer-events: none;
}
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: var(--login-panel-width);
    background-image: url('https://cadvietarchitects.com/wp-content/uploads/2026/04/ChatGPT-Image-23_15_03-16-thg-4-2026-2.png');
    background-position: left center;
    background-repeat: no-repeat;
    background-size: 100% auto;
    z-index: 1;
    pointer-events: none;
}
.login-container {
    width: var(--login-panel-width);
    min-width: 360px;
    max-width: 430px;
    height: 100vh;
    margin-left: 0;
    padding: 34px 28px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 20;
    background: #ffffff;
    border-left: 1px solid rgba(0,0,0,0.08);
    box-shadow: -16px 0 36px rgba(0,0,0,0.16);
}
.sun-field {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: var(--login-panel-width);
    z-index: 6;
    pointer-events: none;
    overflow: hidden;
}
.sun-counter {
    position: fixed;
    top: 14px;
    right: calc(var(--login-panel-width) + 16px);
    z-index: 7;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 999px;
    font-weight: 700;
    color: #222;
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.sun-counter-icon {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    border-radius: 6px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.16);
}
.sun-drop {
    position: absolute;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    line-height: 1;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.18));
    pointer-events: auto;
    animation: sun-fall linear forwards;
}
@keyframes sun-fall {
    0% { transform: translateY(-10vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    100% { transform: translateY(110vh) rotate(220deg); opacity: 0.9; }
}
.login-card {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 4px;
    box-shadow: none;
    position: relative;
    overflow: hidden;
}
.login-header {
    text-align: left;
    margin-bottom: 24px;
}
.login-header h2 {
    color: #111;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.login-header p {
    color: #444;
    font-size: 1rem;
    font-weight: 400;
}

/* Form */
.form-group { margin-bottom: 20px; position: relative; }
.input-wrapper { position: relative; display: flex; flex-direction: column; }
.input-wrapper input {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 22px 16px 12px 16px;
    color: #111;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.2s ease;
    width: 100%;
    outline: none;
}
.input-wrapper input::placeholder { color: transparent; }
.input-wrapper label {
    position: absolute;
    left: 14px;
    top: 8px;
    color: #555;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    pointer-events: none;
    transform-origin: left top;
}
.input-wrapper input:focus,
.input-wrapper input:valid {
    border-color: #BC1116;
    background: #fff;
    box-shadow: 0 8px 20px rgba(188,17,22,0.08);
}
.input-wrapper input:focus + label,
.input-wrapper input:valid + label {
    transform: translateY(-8px) scale(0.9);
    color: #BC1116;
    font-weight: 600;
}
.focus-border { display: none; }

/* Error */
.error-message {
    display: block;
    color: #c1121f;
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
    margin-left: 2px;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}
.error-message.show { opacity: 1; transform: translateY(0); }
.form-group.error .input-wrapper input {
    border-color: #c1121f;
    background: #fff1f1;
}

/* Buttons */
.btn {
    background: linear-gradient(135deg, #BC1116 0%, #9e0f13 100%);
    border: none;
    border-radius: 12px;
    padding: 14px 18px;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-shadow: 0 10px 20px rgba(188,17,22,0.28);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 26px rgba(188,17,22,0.35); }
.btn:active { transform: translateY(0); }
.btn::before {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
    transition: left 0.4s ease;
}
.btn:hover::before { left: 100%; }
.btn.loading { pointer-events: none; }
.btn-text { transition: opacity 0.2s ease; }
.btn-loader {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 18px; height: 18px;
    border: 2px solid transparent; border-top: 2px solid white;
    border-radius: 50%; opacity: 0;
    animation: spin 1s linear infinite;
    transition: opacity 0.2s ease;
}
.btn.loading .btn-text { opacity: 0; }
.btn.loading .btn-loader { opacity: 1; }

/* Form options */
.form-options {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}
.remember-wrapper { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.remember-wrapper input[type="checkbox"] { display: none; }
.checkbox-label {
    color: #222;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    display: flex; align-items: center; gap: 8px;
}
.checkmark {
    width: 18px; height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background: #f8fafc;
}
.remember-wrapper input[type="checkbox"]:checked ~ .checkbox-label .checkmark {
    background: #BC1116;
    border-color: #BC1116;
    color: #fff;
}
.remember-wrapper input[type="checkbox"]:checked ~ .checkbox-label .checkmark::after {
    content: '✓';
    font-size: 11px;
    font-weight: 700;
}

/* Password toggle */
.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 48px; }
.password-toggle {
    position: absolute; right: 10px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    padding: 6px; color: #555;
    transition: color 0.2s ease;
    z-index: 2;
}
.password-toggle:hover { color: #000; }
.eye-icon {
    display: block; width: 20px; height: 20px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(0,0,0,0.55)' stroke-width='1.5'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'/%3e%3c/svg%3e");
    background-size: contain; background-repeat: no-repeat; background-position: center;
}
.eye-icon.show-password {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(0,0,0,0.55)' stroke-width='1.5'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 11-4.243-4.243m4.242 4.242L9.88 9.88'/%3e%3c/svg%3e");
}

/* Success (tùy chọn) */
.success-message {
    display: none;
    text-align: center;
    padding: 32px 16px;
    opacity: 0;
    transform: translateY(12px);
    transition: all 0.4s ease;
}
.success-message.show { display: block; opacity: 1; transform: translateY(0); }
.success-icon {
    width: 56px; height: 56px; background: #22c55e;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: white; margin: 0 auto 14px;
}
.success-message h3 { color: #111; font-size: 1.3rem; margin-bottom: 6px; }
.success-message p { color: #444; }

/* Animations */
@keyframes spin { 0%{transform:translate(-50%,-50%) rotate(0deg);} 100%{transform:translate(-50%,-50%) rotate(360deg);} }
@keyframes shake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-5px);} 75%{transform:translateX(5px);} }
@keyframes successPulse { 0%{transform:scale(0);} 50%{transform:scale(1.1);} 100%{transform:scale(1);} }

/* Responsive */
@media (max-width: 480px) {
    body {
        padding: 14px;
    }
    body::before { opacity: 0.36; }
    body::after {
        right: 0;
        background-position: center center;
        background-size: cover;
    }
    .login-container {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        min-width: 0;
        max-width: 420px;
        height: auto;
        margin: 0 auto;
        padding: 0;
        background: transparent;
        border-left: none;
        box-shadow: none;
        z-index: 2;
    }
    .sun-field { right: 0; }
    .sun-counter { right: 16px; }
    .login-card {
        padding: 24px;
        margin: 0;
        background: rgba(255,255,255,0.94);
        border: 1px solid rgba(0,0,0,0.08);
        border-radius: 16px;
        box-shadow: 0 10px 28px rgba(0,0,0,0.18);
    }
    .login-header h2 { font-size: 1.6rem; }
    .form-options { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (max-width: 980px) and (min-width: 481px) {
    :root {
        --login-panel-width: min(420px, 42vw);
    }
    .login-container {
        width: var(--login-panel-width);
        min-width: 320px;
        padding: 28px 22px;
    }
    .sun-field {
        right: var(--login-panel-width);
    }
    .sun-counter {
        right: calc(var(--login-panel-width) + 16px);
    }
}