/* Nordic Theme & Typography */
:root {
    /* Light Theme (Default) */
    --bg-color: #f7f9fa;
    --surface-color: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --accent-color: #2563ea;
    --accent-hover: #1d4ed8;
    --error-bg: #fef2f2;
    --error-text: #991b1b;
    
    /* Layout */
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --accent-color: #3b82f6;
    --accent-hover: #60a5fa;
    --error-bg: #450a0a;
    --error-text: #fca5a5;
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    line-height: 1.5;
    transition: background-color var(--transition), color var(--transition);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Utilities & Components */
.max-w-md {
    width: 100%;
    max-width: 28rem;
}

.w-full { width: 100%; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }

.hidden { display: none !important; }

/* Nordic Card Style */
.card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition), border-color var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Forms */
label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

input[type="text"], input[type="password"], select {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    transition: var(--transition);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 234, 0.1);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-secondary);
}

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

/* States */
.error-box {
    background-color: var(--error-bg);
    color: var(--error-text);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Modal / Settings Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow-md);
    transform: scale(0.95);
    transition: transform var(--transition);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Loading Spinner */
.spinner {
    animation: spin 1s linear infinite;
    color: var(--accent-color);
    width: 2rem;
    height: 2rem;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
