:root {
    --auth-brand-blue: #000098;
    --auth-brand-dark: #2c3e50;
    --auth-success: #10b981;
    --auth-error: #ef4444;
    --auth-warning: #f59e0b;
    --auth-white: #ffffff;
    --auth-surface: #ffffff;
    --auth-bg-start: #f5f7fa;
    --auth-bg-end: #e4e7f4;
    --auth-border: #e2e8f0;
    --auth-text-main: #333333;
    --auth-text-light: #666666;
    --auth-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    --auth-shadow-sm: 0 4px 12px rgba(0, 0, 152, 0.2);
    --auth-radius: 16px;
    --auth-radius-sm: 8px;
    --auth-transition: all 0.3s ease;
    --auth-transition-fast: all 0.2s ease;
}

.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--auth-bg-start) 0%, var(--auth-bg-end) 100%);
    padding: 15px;
}

.auth-card {
    background: var(--auth-surface);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    padding: 40px;
    max-width: 450px;
    margin: 60px auto;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--auth-brand-blue) 0%, var(--auth-brand-dark) 100%);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--auth-text-main);
    margin-bottom: 8px;
}

.auth-header p {
    font-size: 14px;
    color: var(--auth-text-light);
    margin: 0;
}

.nav-tabs .nav-link {
    color: var(--auth-text-light);
    font-weight: 600;
    padding: 12px 24px;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm) var(--auth-radius-sm) 0 0;
    background: #f8fafc;
    transition: var(--auth-transition);
}

.nav-tabs .nav-link.active {
    color: var(--auth-brand-blue);
    background: var(--auth-white);
    border-bottom: 1px solid var(--auth-white);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

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

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--auth-text-main);
    margin-bottom: 8px;
    font-size: 15px;
}

.form-control {
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    padding: 12px 16px;
    font-size: 15px;
    transition: var(--auth-transition-fast);
    background: var(--auth-white);
    width: 100%;
}

.form-control:focus {
    border-color: var(--auth-brand-blue);
    box-shadow: 0 0 0 3px rgba(0, 0, 152, 0.1);
    outline: none;
}

.form-control:hover {
    border-color: #cbd5e1;
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--auth-text-light);
    font-size: 16px;
    padding: 4px;
    border: none;
    background: none;
    transition: var(--auth-transition-fast);
}

.toggle-password:hover {
    color: var(--auth-brand-blue);
}

.btn-primary {
    background: linear-gradient(90deg, var(--auth-brand-blue) 0%, var(--auth-brand-dark) 100%);
    border: none;
    border-radius: var(--auth-radius-sm);
    padding: 14px 24px;
    font-weight: 600;
    font-size: 16px;
    transition: var(--auth-transition);
    box-shadow: var(--auth-shadow-sm);
    color: var(--auth-white);
    cursor: pointer;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 152, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-left: -9px;
    margin-top: -9px;
    border: 2px solid transparent;
    border-top-color: var(--auth-white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-loading span {
    opacity: 0.7;
}

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

.auth-links {
    margin-top: 24px;
    text-align: center;
    border-top: 1px solid var(--auth-border);
    padding-top: 20px;
}

.auth-links a {
    display: block;
    color: var(--auth-text-light);
    text-decoration: none;
    font-size: 14px;
    margin: 8px 0;
    transition: var(--auth-transition-fast);
}

.auth-links a:hover {
    color: var(--auth-brand-blue);
}

.text-primary {
    color: var(--auth-brand-blue) !important;
    font-weight: 500;
    text-decoration: none;
    transition: var(--auth-transition-fast);
}

.text-primary:hover {
    color: var(--auth-brand-dark) !important;
}

.batch-group {
    margin-bottom: 16px;
}

.batch-group label {
    display: flex;
    align-items: center;
    margin: 0;
    font-weight: 400;
    font-size: 14px;
    color: var(--auth-text-light);
    cursor: pointer;
}

.batch-group input[type="checkbox"],
.batch-group input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--auth-brand-blue);
}

.form-error {
    color: var(--auth-error);
    font-size: 13px;
    margin-top: 6px;
    display: none;
    font-weight: 500;
}

.form-error.show {
    display: block;
    animation: shake 0.4s ease-in-out;
}

.form-control.has-error {
    border-color: var(--auth-error);
}

.form-control.has-error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.password-strength {
    margin-top: 8px;
}

.password-strength-meter {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s ease;
    background: #ef4444;
}

.password-strength-text {
    font-size: 12px;
    font-weight: 500;
}

.password-strength-text.weak {
    color: #ef4444;
}

.password-strength-text.fair {
    color: #f59e0b;
}

.password-strength-text.good {
    color: #3b82f6;
}

.password-strength-text.strong {
    color: #10b981;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 450px;
}

.toast {
    background: var(--auth-white);
    border-radius: var(--auth-radius-sm);
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--auth-brand-blue);
}

.toast.success {
    border-left-color: var(--auth-success);
}

.toast.error {
    border-left-color: var(--auth-error);
}

.toast.warning {
    border-left-color: var(--auth-warning);
}

.toast-icon {
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--auth-success);
}

.toast.error .toast-icon {
    color: var(--auth-error);
}

.toast.warning .toast-icon {
    color: var(--auth-warning);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--auth-text-main);
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: var(--auth-text-light);
    line-height: 1.5;
    margin: 0;
}

.toast-close {
    cursor: pointer;
    color: var(--auth-text-light);
    font-size: 18px;
    margin-left: 12px;
    padding: 4px;
    transition: var(--auth-transition-fast);
}

.toast-close:hover {
    color: var(--auth-text-main);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

.toast.hiding {
    animation: fadeOut 0.3s ease forwards;
}

.auth-info-box {
    background: #f0f7ff;
    border: 1px solid #d1e4f5;
    border-radius: var(--auth-radius-sm);
    padding: 12px 16px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #0c4a6e;
    line-height: 1.6;
}

.auth-info-box i {
    margin-right: 8px;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--auth-text-light);
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.auth-divider span {
    padding: 0 16px;
}

@media (max-width: 768px) {
    .auth-card {
        padding: 24px;
        margin: 20px;
    }

    .auth-header h2 {
        font-size: 24px;
    }

    .nav-tabs .nav-link {
        padding: 10px 16px;
        font-size: 14px;
    }

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

    .btn-primary {
        padding: 12px 20px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 20px;
        margin: 16px 12px;
    }

    .auth-header h2 {
        font-size: 22px;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 14px;
    }

    .form-group label {
        font-size: 14px;
    }

    .btn-primary {
        padding: 12px 18px;
        font-size: 14px;
    }

    .toast-container {
        left: 12px;
        right: 12px;
        max-width: none;
    }
}