:root {
    /* Colors */
    --color-primary: #6B30FF;
    --color-primary-dark: #5a28d9;
    --color-primary-light: #8554FF;
    --color-text: #2D2D2D;
    --color-white: #ffffff;
    --color-black: #000000;
    --color-bg: #F8F8F8;
    --color-bg-secondary: #F5F7FF;
    --color-bg-drag: #E8E0FF;
    --color-border: rgba(0, 0, 0, 0.1);
    --color-border-dark: rgba(0, 0, 0, 0.30);
    --color-shadow: rgba(0, 0, 0, 0.08);
    --color-shadow-dark: rgba(0, 0, 0, 0.16);
    --color-overlay: rgba(0, 0, 0, 0.05);
    --color-error: #ff4444;
    --color-error-red: #ff6363;
    --color-error-bg: #fceaea;
    --color-warning: #f59e0b;
    --color-success: #3CD730;
    --color-success-text: #194304;
    --color-pending-text: #2d2d2d;
    --color-failed-text: #480000;
    --color-link: #025fc8;
    --color-table-border: rgba(0, 0, 0, 0.04);
    --color-table-header: rgba(0, 0, 0, 0.4);
    --color-text-secondary: rgba(45, 45, 45, 0.7);
    --color-text-muted: rgba(0, 0, 0, 0.5);
    --color-text-lighter: rgba(45, 45, 45, 0.08);
    --color-text-light: rgba(45, 45, 45, 0.1);
    --color-text-medium: rgba(45, 45, 45, 0.2);
    --light-grey-color: #E0E0E0;
    --color-disabled: #8D8D8D;
    --color-pressed: #313131;
    --color-grey-bg: #F3F3F3;
    --color-grey-bg-light: #f5f5f5;
    --color-error-light: #FFD0D0;
    
    /* Spacing */
    --gap-xs: 0.25rem;
    --gap-sm: 0.5rem;
    --gap-md: 0.75rem;
    --gap-lg: 1rem;
    --gap-xl: 1.5rem;
    --gap-2xl: 2rem;
    
    /* Padding */
    --padding-xs: 0.5rem;
    --padding-sm: 0.625rem;
    --padding-md: 0.75rem;
    --padding-lg: 1rem;
    --padding-xl: 1.5rem;
    --padding-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.625rem;
    --radius-xl: 1.5rem;
    --radius-full: 50rem;
    
    /* Font Sizes */
    --font-xs: 0.625rem;
    --font-sm: 0.75rem;
    --font-md: 0.875rem;
    --font-base: 1rem;
    --font-lg: 1.25rem;
    --font-xl: 1.5rem;
    --font-2xl: 1.75rem;
    --font-3xl: 2rem;
    
    /* Opacity */
    --opacity-hover: 0.9;
    --opacity-active: 0.8;
    --opacity-disabled: 0.5;
}

* {
    font-family: "SF Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "SF Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
}

/* Common utility classes */
.text-center {
    text-align: center;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.w-full {
    width: 100%;
}

/* Highlight animation - Enhanced for better visibility */
@keyframes highlight-pulse {
    0% {
        box-shadow: 0 0 0 0 rgb(from var(--color-primary) r g b / 60%);
        background-color: transparent;
    }
    50% {
        box-shadow: 0 0 20px 12px rgb(from var(--color-primary) r g b / 35%);
        background-color: rgb(from var(--color-primary) r g b / 22%);
    }
    100% {
        box-shadow: 0 0 0 0 rgb(from var(--color-primary) r g b / 0%);
        background-color: transparent;
    }
}

.highlight-attention {
    animation: highlight-pulse 0.8s ease-out;
    border-radius: var(--radius-md);
}

/* Calm highlight animation */
@keyframes highlight-pulse-calm {
    0% {
        box-shadow: 0 0 0 0 rgb(from var(--color-primary) r g b / 30%);
        background-color: transparent;
    }
    50% {
        box-shadow: 0 0 10px 5px rgb(from var(--color-primary) r g b / 15%);
        background-color: rgb(from var(--color-primary) r g b / 10%);
    }
    100% {
        box-shadow: 0 0 0 0 rgb(from var(--color-primary) r g b / 0%);
        background-color: transparent;
    }
}

.highlight-attention-calm {
    animation: highlight-pulse-calm 0.8s ease-out;
    border-radius: var(--radius-md);
}

.transition {
    transition: all 0.2s;
}

/* ============================================================================
   BUTTON STYLES
   ============================================================================ */

/* Primary Button - Main action buttons with primary color */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--gap-sm);
    padding: 0 var(--padding-xl);
    height: var(--padding-2xl);
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-base);
    font-weight: 400;
    line-height: var(--font-base);
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-black);
}

.btn-primary:active:not(:disabled) {
    background: var(--color-pressed);
}

.btn-primary:focus-visible {
    outline: none;
    background: var(--color-pressed);
    box-shadow: 0 0 0 0.125rem var(--color-white), 0 0 0 0.25rem var(--color-primary);
}

.btn-primary:disabled {
    background: var(--color-disabled);
    cursor: not-allowed;
}

/* Secondary Button - Subtle actions with light background */
.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--gap-sm);
    padding: var(--padding-md);
    background: var(--color-text-light);
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: var(--font-base);
    font-weight: 400;
    line-height: var(--font-base);
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-secondary:hover {
    background: var(--color-text-medium);
}

.btn-secondary:disabled {
    opacity: var(--opacity-disabled);
    cursor: not-allowed;
}

/* Text Link Button - Link-style button (used for Cancel, etc.) */
.btn-link {
background: none;
    border: none;
    color: var(--color-link);
    cursor: pointer;
    padding: var(--padding-sm) var(--gap-2xl);
    font-size: 1rem;
    font-style: normal;
    font-weight: 400;
    line-height: 100%;
}

.btn-link:hover {
    opacity: var(--opacity-hover);
}

.btn-link:disabled {
    opacity: var(--opacity-disabled);
    cursor: not-allowed;
}

/* ============================================================================
   AUTHENTICATION PAGE LAYOUT (Two-Column: Purple Panel + Form)
   ============================================================================ */

/* Main container for auth pages */
.auth-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Left Panel - Purple with Logo */
.auth-left-panel {
    width: 50%;
    background-color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gap-2xl);
}

.auth-logo {
    max-width: 18.75rem;
    height: auto;
    filter: brightness(0) invert(1);
}

/* Right Panel - Form */
.auth-right-panel {
    width: 50%;
    background-color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gap-2xl);
}

.auth-form-wrapper {
    width: 100%;
    max-width: 35.8125rem;
}

/* Title */
.auth-title {
    font-weight: 400;
    font-size: var(--font-3xl);
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: var(--gap-2xl);
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--gap-xl);
}

/* Field Container */
.auth-field {
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
}

/* Label */
.auth-label {
    font-weight: 400;
    font-size: var(--font-base);
    line-height: 1.5;
    letter-spacing: -0.02em;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
}

/* Input Wrapper (for inputs with icons) */
.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Input */
.auth-input {
    width: 100%;
    height: var(--padding-2xl);
    padding: var(--padding-md) var(--padding-lg);
    font-weight: 400;
    font-size: var(--font-base);
    line-height: 1.5;
    letter-spacing: -0.02em;
    color: var(--color-text);
    background-color: var(--color-white);
    border: 0.0625rem solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s ease;
}

.auth-input::placeholder {
    color: var(--color-text-muted);
}

.auth-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.auth-input-wrapper .auth-input {
    padding-right: var(--padding-2xl);
}

/* Input Icon */
.auth-input-icon {
    position: absolute;
    right: var(--padding-lg);
    width: var(--font-lg);
    height: var(--font-lg);
    pointer-events: none;
}

/* Password Toggle Button */
.auth-toggle-password {
    position: absolute;
    right: var(--padding-lg);
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--gap-xs);
    color: var(--color-text-muted);
    transition: color 0.2s ease;
}

.auth-toggle-password:hover {
    color: var(--color-text);
}

.auth-input-wrapper .auth-toggle-password {
    right: var(--padding-2xl);
}

.auth-toggle-password.active {
    color: var(--color-primary);
}

/* Terms & Conditions */
.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: var(--gap-sm);
}

.auth-checkbox {
    width: var(--font-lg);
    height: var(--font-lg);
    margin-top: 0.125rem;
    cursor: pointer;
    flex-shrink: 0;
}

.auth-terms-label {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: var(--font-base);
    line-height: 1.5;
    letter-spacing: -0.02em;
    color: var(--color-text);
    cursor: pointer;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    height: 3.60625rem;
    background-color: var(--color-primary);
    color: var(--color-white);
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    font-size: var(--font-base);
    line-height: 1.5;
    letter-spacing: -0.02em;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.auth-submit-btn:hover {
    background-color: var(--color-primary-dark);
}

.auth-submit-btn:active {
    opacity: var(--opacity-hover);
}

.auth-submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Button loading state */
.auth-submit-btn .btn-text {
    display: inline;
}

.auth-submit-btn .btn-loader {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-loader {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.125rem solid rgb(from var(--color-white) r g b / 0.3);
    border-top: 0.125rem solid var(--color-white);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

/* Footer */
.auth-footer {
    margin-top: var(--gap-xl);
    text-align: center;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: var(--font-base);
    line-height: 1.5;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

/* Links */
.auth-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.auth-link:hover {
    opacity: var(--opacity-active);
    text-decoration: underline;
}

/* Error Message */
.auth-error-msg {
    margin-top: var(--gap-lg);
    padding: var(--padding-md) var(--padding-lg);
    background-color: var(--color-error-bg);
    border: 0.0625rem solid var(--color-error-red);
    border-radius: var(--radius-sm);
    display: none;
}

.auth-error-msg p {
    margin: 0;
    color: var(--color-error);
    font-size: var(--font-md);
    line-height: 1.4;
}

.auth-error-msg p:not(:empty) {
    display: block;
}

.auth-error-msg:has(p:not(:empty)) {
    display: block;
}

/* Special content sections (like QR code for MFA) */
.auth-special-content {
    margin: var(--gap-xl) 0;
    text-align: center;
}

.auth-list {
    text-align: left;
    padding-left: var(--gap-xl);
    margin: var(--gap-lg) 0;
}

.auth-list li {
    margin-bottom: var(--gap-sm);
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: var(--font-base);
    color: var(--color-text);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .auth-left-panel {
        width: 40%;
    }
    
    .auth-right-panel {
        width: 60%;
    }
    
    .auth-logo {
        max-width: 15rem;
    }
    
    .auth-form-wrapper {
        max-width: 30rem;
    }
}

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }
    
    .auth-left-panel {
        width: 100%;
        min-height: 12.5rem;
        padding: var(--gap-2xl) var(--padding-lg);
    }
    
    .auth-right-panel {
        width: 100%;
        padding: var(--gap-2xl) var(--padding-lg);
    }
    
    .auth-logo {
        max-width: 12.5rem;
    }
    
    .auth-form-wrapper {
        max-width: 100%;
    }
    
    .auth-title {
        font-size: var(--font-2xl);
    }
}


/* ============================================================================
   ERROR STYLES FOR FORM VALIDATION
   ============================================================================ */

.error-input-style {
    border: 0.0625rem solid var(--color-error) !important;
    background: var(--color-error-bg) !important;
}

.error-label-style {
    color: var(--color-error) !important;
}

/* Disabled link button state */
.btn-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button with spinner */
.btn-primary .spinner,
.btn-secondary .spinner {
    color: currentColor;
}

.btn-primary:disabled .spinner,
.btn-secondary:disabled .spinner {
    color: var(--color-text-medium);
}
