:root {
    --icon-bar-width: 60px;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 60px;
    /* Fonts */
    --bs-font-sans-serif: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Dark Theme (Default) */
:root,
[data-theme=dark] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --bg-card: #1e1e1e;
    --border-color: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #a0a0a0;
    --accent-color: #0d6efd;
    --link-color: #6ea8fe;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    /* Scrollbar Variables */
    --scrollbar-track-bg: #141414;
    --scrollbar-thumb-bg: #2a2a2a;
    --scrollbar-thumb-hover-bg: #3a3a3a;
    /* Bootstrap Modal Variables Override */
    --bs-modal-bg: #1e1e1e;
    --bs-modal-color: #ffffff;
    --bs-modal-border-color: #2a2a2a;
    --bs-body-bg: #0a0a0a;
    --bs-border-color-translucent: rgba(255, 255, 255, 0.15);
}

/* Light Theme */
[data-theme=light] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #fafafa;
    --bg-card: #ffffff;
    --border-color: #e0e0e0;
    --text-primary: #1a1a1a;
    --text-secondary: #4a4a4a;
    --text-muted: #4a4a4a;
    --accent-color: #0d6efd;
    --link-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    /* Scrollbar Variables */
    --scrollbar-track-bg: #ffffff;
    --scrollbar-thumb-bg: #c0c0c0;
    --scrollbar-thumb-hover-bg: #a0a0a0;
    /* Bootstrap Modal Variables Override */
    --bs-modal-bg: #ffffff;
    --bs-modal-color: #1a1a1a;
    --bs-modal-border-color: #e0e0e0;
    --bs-body-bg: #f5f5f5;
    --bs-border-color-translucent: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: var(--bs-font-sans-serif);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

.login-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-primary);
}

.login-brand-panel {
    flex: 1;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, #1a1a2e 100%);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

.login-brand-panel::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.1) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.brand-content {
    position: relative;
    z-index: 1;
    max-width: 500px;
}

.brand-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 2rem;
    margin-left: auto;
    margin-right: auto;
    display: block;
    filter: drop-shadow(0 10px 30px rgba(13, 110, 253, 0.3));
}

.brand-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.brand-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.login-form-panel {
    flex: 1;
    background: var(--bg-secondary);
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.theme-toggle-login {
    position: absolute;
    top: 2rem;
    right: 2rem;
}

.login-form-container {
    width: 100%;
    max-width: 650px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.setup-section-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.setup-section-header:first-of-type {
    margin-top: 0;
}

.form-group {
    margin-bottom: 1rem;
    position: relative;
}

.input-icon-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.125rem;
    pointer-events: none;
    z-index: 1;
}

.form-control-modern {
    padding: 0.875rem 1rem 0.875rem 3rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.form-control-modern:focus {
    background: var(--bg-primary);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
    outline: none;
    color: var(--text-primary);
}

.form-control-modern::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-control-modern:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-control-modern.is-invalid {
    border-color: var(--danger-color);
    background-image: none;
    padding-right: 1rem;
}

.form-control-modern.is-valid {
    border-color: var(--success-color);
    background-image: none;
    padding-right: 1rem;
}

.input-icon-wrapper .form-control-modern.is-valid,
.input-icon-wrapper .form-control-modern.is-invalid {
    padding-right: 3rem;
}

.invalid-feedback,
.valid-feedback {
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.125rem;
    transition: color 0.2s;
    z-index: 2;
}

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

.form-check-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-check-modern .form-check-input {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    cursor: pointer;
    width: 1.125rem;
    height: 1.125rem;
}

.form-check-modern .form-check-input:checked {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.form-check-modern .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.form-check-modern label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    margin-bottom: 0;
}

.form-check-modern .form-check-input:disabled+label {
    opacity: 0.6;
    cursor: not-allowed;
}

.license-key-group {
    margin-left: 1.625rem;
    margin-bottom: 1rem;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.license-key-group.hidden {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin-bottom: 0;
}

.btn-login {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 1.5rem;
}

.btn-login:disabled {
    cursor: not-allowed;
}

.btn-login .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

.alert-login {
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.row-gap-3 {
    gap: 1rem;
}

@media (max-width: 992px) {
    .login-container {
        flex-direction: column;
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        padding: 2rem 1.5rem;
    }

    .login-card {
        padding: 2rem 1.5rem;
    }

    .theme-toggle-login {
        top: 1rem;
        right: 1rem;
    }
}

@media (max-width: 576px) {
    .login-card {
        padding: 1.5rem 1rem;
    }

    .login-header h1 {
        font-size: 1.5rem;
    }
}

[data-theme=light] .login-brand-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 50%, #dee2e6 100%);
}

[data-theme=light] .login-brand-panel::before {
    background: radial-gradient(circle, rgba(13, 110, 253, 0.05) 0%, transparent 70%);
}

[data-theme=light] .brand-logo {
    filter: drop-shadow(0 10px 30px rgba(13, 110, 253, 0.2));
}

.brand-logo-light {
    display: none;
}

[data-theme=light] .brand-logo-dark {
    display: none;
}

[data-theme=light] .brand-logo-light {
    display: block;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 0;
    color: var(--text-secondary);
    font-size: 1rem;
}

.feature-item i {
    color: var(--accent-color);
    font-size: 1.25rem;
}

.forgot-password {
    text-align: center;
    margin-top: 1.5rem;
}

.forgot-password a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.forgot-password a:hover {
    color: #0a58ca;
    text-decoration: underline;
}