:root {
    --primary-color: #E63946;
    --primary-hover: #D62839;
    --primary-active: #C12030;
    --primary-light: #FEEAEC;
    --accent-color: #1D3557;
    --success-color: #2A9D8F;
    --warning-color: #F4A261;
    --error-color: #E76F51;
    --white: #FFFFFF;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.35s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-700);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
}

input {
    font-family: inherit;
    outline: none;
    border: none;
}

.login-container {
    min-height: 100vh;
    display: flex;
}

.brand-section {
    flex: 1;
    position: relative;
    background: linear-gradient(135deg, var(--accent-color) 0%, #264D7A 50%, #2A6F97 100%);
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.brand-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.brand-content {
    position: relative;
    z-index: 1;
    max-width: 480px;
    color: var(--white);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.logo-icon {
    width: 52px;
    height: 52px;
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.brand-slogan {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.brand-desc {
    font-size: 15px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 36px;
}

.brand-features {
    display: flex;
    gap: 24px;
    margin-bottom: 48px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    font-size: 14px;
}

.feature-item i {
    font-size: 18px;
    color: var(--primary-color);
}

.brand-illustration {
    margin-top: 20px;
}

.brand-illustration img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    opacity: 0.9;
}

.form-section {
    width: 520px;
    min-width: 400px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.login-form-wrapper {
    width: 100%;
    max-width: 380px;
}

.form-header {
    margin-bottom: 36px;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
}

.admin-badge i {
    font-size: 14px;
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.form-subtitle {
    font-size: 15px;
    color: var(--gray-500);
}

.login-form {
    width: 100%;
}

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

.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-label i {
    font-size: 16px;
    color: var(--gray-400);
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    color: var(--gray-800);
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input:hover {
    border-color: var(--gray-300);
    background: var(--white);
}

.form-input:focus {
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.form-input.error {
    border-color: var(--error-color);
    background: #FEF2F2;
}

.form-input.error:focus {
    box-shadow: 0 0 0 3px rgba(231, 111, 81, 0.1);
}

.input-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 18px;
    padding: 4px;
    transition: color var(--transition-fast);
}

.toggle-password:hover {
    color: var(--gray-600);
}

.captcha-wrapper {
    display: flex;
    gap: 12px;
}

.captcha-input {
    flex: 1;
}

.captcha-image {
    width: 120px;
    height: 48px;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    border: 1.5px solid var(--gray-200);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.captcha-image:hover {
    border-color: var(--primary-color);
    transform: scale(1.02);
}

.captcha-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        rgba(0,0,0,0.03) 5px,
        rgba(0,0,0,0.03) 10px
    );
}

#captchaText {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--accent-color);
    font-family: 'Courier New', monospace;
    position: relative;
    z-index: 1;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

.form-error {
    display: block;
    font-size: 13px;
    color: var(--error-color);
    margin-top: 6px;
    min-height: 18px;
    padding-left: 4px;
}

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

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-600);
}

.remember-me input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    background: var(--white);
}

.remember-me input:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.remember-me input:checked + .checkbox-custom::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

.remember-me:hover .checkbox-custom {
    border-color: var(--primary-color);
}

.forgot-link {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.forgot-link:hover {
    color: var(--primary-hover);
    gap: 8px;
}

.form-alert {
    padding: 12px 16px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: var(--radius-md);
    color: var(--error-color);
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-alert.success {
    background: #ECFDF5;
    border-color: #A7F3D0;
    color: var(--success-color);
}

.form-alert.warning {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: var(--warning-color);
}

.btn-login {
    width: 100%;
    height: 50px;
    background: var(--primary-color);
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md), 0 4px 12px rgba(230, 57, 70, 0.3);
    transform: translateY(-1px);
}

.btn-login:active {
    background: var(--primary-active);
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn-login:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-login .btn-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.form-footer {
    margin-top: 32px;
    text-align: center;
}

.copyright-text {
    font-size: 13px;
    color: var(--gray-400);
}

@media screen and (max-width: 1024px) {
    .brand-section {
        padding: 40px;
    }
    
    .brand-slogan {
        font-size: 28px;
    }
    
    .form-section {
        width: 460px;
        padding: 32px;
    }
}

@media screen and (max-width: 768px) {
    .login-container {
        flex-direction: column;
    }
    
    .brand-section {
        min-height: 280px;
        padding: 32px 24px;
    }
    
    .brand-content {
        max-width: 100%;
    }
    
    .brand-logo {
        margin-bottom: 24px;
    }
    
    .brand-slogan {
        font-size: 24px;
        margin-bottom: 12px;
    }
    
    .brand-desc {
        font-size: 14px;
        margin-bottom: 20px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .brand-features {
        margin-bottom: 0;
        gap: 12px;
    }
    
    .feature-item {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .brand-illustration {
        display: none;
    }
    
    .form-section {
        width: 100%;
        min-width: unset;
        flex: 1;
        padding: 32px 24px;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        margin-top: -20px;
        position: relative;
        z-index: 2;
    }
    
    .login-form-wrapper {
        max-width: 100%;
    }
    
    .form-title {
        font-size: 24px;
    }
}

@media screen and (max-width: 480px) {
    .brand-section {
        min-height: 220px;
        padding: 24px 20px;
    }
    
    .brand-slogan {
        font-size: 20px;
    }
    
    .brand-features {
        flex-wrap: wrap;
    }
    
    .form-section {
        padding: 24px 20px;
    }
    
    .form-header {
        margin-bottom: 24px;
    }
    
    .admin-badge {
        margin-bottom: 12px;
    }
    
    .form-title {
        font-size: 22px;
    }
    
    .form-input {
        height: 46px;
    }
    
    .captcha-image {
        width: 100px;
        height: 46px;
    }
    
    #captchaText {
        font-size: 18px;
        letter-spacing: 4px;
    }
    
    .btn-login {
        height: 48px;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-group {
    animation: fadeInUp 0.4s ease forwards;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.15s; }
.form-group:nth-child(3) { animation-delay: 0.2s; }
.form-options { animation: fadeInUp 0.4s ease 0.25s forwards; opacity: 0; }
.btn-login { animation: fadeInUp 0.4s ease 0.3s forwards; opacity: 0; }

.shake {
    animation: shake 0.5s ease;
}