:root {
    /* Color Palette - Minimalist & Neutral */
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #666666;
    --color-border: #e0e0e0;
    --color-primary: #007aff; /* Bold accent */
    --color-primary-hover: #0056b3;
    --color-error: #dc3545;
    --color-error-bg: #fdf2f2;
    --color-success: #28a745;
    --color-success-bg: #f0fdf4;

    /* Typography */
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-size-base: 16px;
    --line-height-base: 1.5;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 600;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

body {
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p {
    margin-bottom: var(--spacing-md);
    color: var(--color-text-secondary);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: underline;
}

/* Button Reset & Base Styles */
button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    transition: all 0.2s ease;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px; /* Increased for better touch targets */
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-medium);
    gap: var(--spacing-sm);
    min-height: 48px; /* Standard touch target height */
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
}

.btn-secondary {
    background-color: var(--color-surface);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-bg);
}

.btn-danger {
    color: var(--color-error);
    font-size: 0.875rem;
    padding: 8px;
}

.btn-block {
    display: flex;
    width: 100%;
}

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

/* Form Styles */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--spacing-xs);
    color: var(--color-text-primary);
}

.form-help {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    margin-top: var(--spacing-xs);
}

input[type="text"], input[type="password"], select {
    font-family: inherit;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s ease;
    -webkit-appearance: none; /* Reset for mobile */
}

input:focus {
    border-color: var(--color-primary);
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    padding: 4px 0;
}

.checkbox-group input {
    width: 20px;
    height: 20px;
    margin-top: 0;
    flex-shrink: 0;
}

.checkbox-group label {
    font-size: 0.9375rem;
    color: var(--color-text-secondary);
    line-height: 1.3;
}

/* Layout & Containers */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.auth-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: var(--spacing-xl);
    position: relative;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-xs);
}

.auth-header p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* Tabs */
.tabs-nav {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--spacing-lg);
}

.tab-link {
    padding: 12px 20px;
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
    font-weight: var(--font-weight-medium);
    border-bottom: 2px solid transparent;
    flex: 1;
}

.tab-link.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Loading & Status */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    z-index: 10;
    backdrop-filter: blur(4px);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--spacing-md);
}

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

.status-message {
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    margin-top: var(--spacing-lg);
    border: 1px solid transparent;
    animation: fadeIn 0.3s ease;
}

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

.status-success {
    background-color: var(--color-success-bg);
    color: var(--color-success);
    border-color: #bbf7d0;
}

.status-error {
    background-color: var(--color-error-bg);
    color: var(--color-error);
    border-color: #fecaca;
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mt-xl {
    margin-top: var(--spacing-xl);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .auth-container {
        padding: var(--spacing-lg);
        box-shadow: none;
        background: transparent;
        border-radius: 0;
    }
    
    .auth-wrapper {
        align-items: flex-start;
        padding: 0;
        background-color: var(--color-surface);
    }

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

    .tab-link {
        font-size: 0.875rem;
    }
}
