:root {
    /* Default Dark Mode - Deep Neutral zinc/slate */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-gradient: linear-gradient(135deg, #09090b 0%, #18181b 100%);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --blob-opacity: 0.2;
    --input-bg: rgba(255, 255, 255, 0.02);
    --error-bg: rgba(220, 38, 38, 0.1);
    --error-text: #fca5a5;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.05);
    --success-text: #6ee7b7;
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --btn-sec-bg: rgba(255, 255, 255, 0.05);
    --btn-sec-hover: rgba(255, 255, 255, 0.1);
}

body.light-mode {
    --bg-gradient: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(0, 0, 0, 0.15);
    --text-main: #1e293b;
    --text-muted: #475569;
    --blob-opacity: 0.25;
    --input-bg: rgba(255, 255, 255, 0.6);
    --error-bg: rgba(239, 68, 68, 0.1);
    --error-text: #991b1b;
    --success: #047857;
    --success-bg: rgba(16, 185, 129, 0.15);
    --success-text: #065f46;
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.1);
    --btn-sec-bg: rgba(0, 0, 0, 0.05);
    --btn-sec-hover: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    overflow-x: hidden;
    transition: background 0.5s ease, color 0.5s ease;
}

/* Background Blobs */
.background-blobs {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: var(--blob-opacity);
    border-radius: 50%;
    animation: move 20s infinite alternate;
    transition: opacity 0.5s ease;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #7c3aed;
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

@keyframes move {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(100px, 100px);
    }
}

/* Glass Card */
.card,
.login-card,
.config-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.8s ease-out;
    transition: all 0.5s ease;
}

.config-card {
    max-width: 500px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    letter-spacing: -0.02em;
}

p.subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.domain-tag {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    width: fit-content;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.2);
}

.login-card .domain-tag {
    margin-left: auto;
    margin-right: auto;
}

.domain-tag.active {
    background: var(--primary);
    box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--primary);
}

/* Forms */
.section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

h2 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

input,
select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}

/* OTP Specific Styling */
.otp-container {
    width: 100%;
    margin: 1.5rem 0;
}

#code {
    height: 70px;
    font-size: 2.5rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: 0.8rem;
    text-align: center;
    padding-left: 1.8rem;
    /* Balancing the letter-spacing offset */
    background: var(--input-bg);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

input:focus,
select:focus {
    border-color: var(--primary);
    background: var(--glass-bg);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

#code:focus {
    border-color: var(--primary);
    background: var(--glass-bg);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

/* Buttons */
button {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

button:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--btn-sec-bg);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--btn-sec-hover);
}

/* Feedback messages */
.message,
.error-message {
    padding: 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.error-message {
    background: var(--error-bg);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: var(--error-text);
    animation: shake 0.4s ease-in-out;
}

.success {
    background: var(--success-bg);
    border: 1px solid var(--success);
    color: var(--success-text);
}

.warning-box {
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    color: var(--warning);
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
    text-align: left;
}

.warning-box strong {
    display: block;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Components */
.current-value {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9rem;
    word-break: break-all;
}

body.light-mode .current-value {
    background: rgba(0, 0, 0, 0.05);
}

.qr-section {
    text-align: center;
    margin-top: 1rem;
}

.qr-section img {
    border: 8px solid white;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.footer,
.nav-links {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer a,
.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer a:hover,
.nav-links a:hover {
    color: var(--primary);
}