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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0b1120 0%, #1a2639 50%, #0f172a 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(37, 99, 235, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(99, 102, 241, 0.06) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-form-light {
    background: rgba(255, 255, 255, 0.98);
    width: 100%;
    max-width: 420px;
    border-radius: 24px;
    padding: 44px 36px 36px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.auth-form-light::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #6366f1, #2563eb);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.brand-logo {
    text-align: center;
    margin-bottom: 8px;
}

.brand-logo img {
    height: 44px;
    margin-bottom: 4px;
}

.brand-logo h2 {
    color: #1e293b;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.5px;
}

.brand-logo span {
    color: #2563eb;
}

.auth-form-light .subtitle {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin-bottom: 28px;
    line-height: 1.5;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #334155;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 18px;
    pointer-events: none;
    transition: color 0.3s;
}

.input-wrapper .toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    transition: color 0.3s;
}

.input-wrapper .toggle-password:hover {
    color: #475569;
}

.form-control {
    width: 100%;
    height: 48px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 14px 0 42px;
    font-size: 14px;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.25s ease;
}

.form-control:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: #ffffff;
    outline: none;
}

.form-control:focus ~ .input-icon {
    color: #2563eb;
}

.form-control.is-invalid {
    border-color: #ef4444;
    background: #fef2f2;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-control.is-valid {
    border-color: #22c55e;
}

.invalid-feedback {
    display: block;
    color: #ef4444;
    font-size: 12px;
    font-weight: 500;
    margin-top: 5px;
    padding-left: 2px;
}

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0 22px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    min-height: auto;
}

.form-check-input {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
    float: none;
    flex-shrink: 0;
}

.form-check-input:checked {
    background-color: #2563eb;
    border-color: #2563eb;
}

.form-check-label {
    color: #475569;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.forgot-link {
    color: #2563eb;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.btn-primary {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #6366f1);
    color: white;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #1d4ed8, #4f46e5);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.35);
}

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

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-primary .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-primary.loading .spinner {
    display: inline-block;
}

.btn-primary.loading .btn-text {
    opacity: 0.8;
}

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

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
}

.alert ul {
    margin: 0;
    padding-left: 18px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-footer {
    text-align: center;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #f1f5f9;
}

.auth-footer p {
    color: #94a3b8;
    font-size: 13px;
}

.auth-footer a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

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

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

    .auth-form-light {
        padding: 32px 20px 28px;
        border-radius: 18px;
    }

    .brand-logo h2 {
        font-size: 20px;
    }

    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .form-control {
        height: 44px;
        font-size: 14px;
    }

    .btn-primary {
        height: 44px;
        font-size: 14px;
    }
}
