:root {
    --primary: #6c63ff;
    --primary-hover: #5a52d5;
    --bg-start: #0f0c29;
    --bg-mid: #302b63;
    --bg-end: #24243e;
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text: #e4e4e7;
    --text-muted: #a1a1aa;
    --input-bg: rgba(255, 255, 255, 0.08);
    --input-border: rgba(255, 255, 255, 0.15);
    --input-focus: rgba(108, 99, 255, 0.5);
    --danger: #ef4444;
    --radius: 16px;
    --radius-sm: 10px;
}

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

html {
    height: 100%;
}

body {
    font-family: 'Inter', 'Montserrat', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-mid) 50%, var(--bg-end) 100%);
    color: var(--text);
    overflow: hidden;
    position: relative;
}

/* Animated background orbs */
.bg-orbs {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.bg-orbs .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.bg-orbs .orb:nth-child(1) {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.bg-orbs .orb:nth-child(2) {
    width: 350px;
    height: 350px;
    background: #ec4899;
    bottom: -80px;
    right: -80px;
    animation-delay: -7s;
}

.bg-orbs .orb:nth-child(3) {
    width: 250px;
    height: 250px;
    background: #06b6d4;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 30px) scale(1.02); }
}

/* Login card */
.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 2.5rem 2rem;
    animation: fadeInUp 0.6s ease-out;
}

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

/* Logo / Brand */
.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand .brand-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), #ec4899);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: #fff;
}

.login-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
}

.login-brand p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Form elements */
.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
    pointer-events: none;
    transition: color 0.2s;
}

.input-wrapper input {
    width: 100%;
    padding: 0.75rem 0.875rem 0.75rem 2.75rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.9375rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--input-focus);
    background: rgba(255, 255, 255, 0.1);
}

.input-wrapper input:focus ~ .input-icon {
    color: var(--primary);
}

/* Password toggle */
.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
    z-index: 2;
}

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

/* Error messages */
.error-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    color: #fca5a5;
    animation: shake 0.4s ease-in-out;
}

.error-message i {
    color: var(--danger);
    font-size: 1rem;
    flex-shrink: 0;
}

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

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

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

.divider span {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* reCAPTCHA container */
.recaptcha-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.recaptcha-wrapper .g-recaptcha {
    transform: scale(0.9);
    transform-origin: center;
}

/* Submit button */
.btn-submit {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border: none;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.35);
}

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

/* Footer link */
.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.login-footer a:hover {
    color: #8b5cf6;
}

/* TFA specific */
.tfa-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.tfa-info .tfa-icon {
    width: 48px;
    height: 48px;
    background: rgba(108, 99, 255, 0.15);
    border: 1px solid rgba(108, 99, 255, 0.3);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    color: var(--primary);
}

.tfa-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
        margin: 0.75rem;
        border-radius: 12px;
    }

    .login-brand h1 {
        font-size: 1.25rem;
    }

    .recaptcha-wrapper .g-recaptcha {
        transform: scale(0.77);
    }
}
