:root {
    /* Design Tokens - Colors (Slate & Gold Premium) */
    --color-brand-primary: #3a4c60;
    --color-brand-primary-dark: #163149;
    --color-brand-primary-deep: #253342;
    --color-brand-accent: #ffc74fe9;
    --color-brand-accent-strong: #ffe49c;
    --color-surface: #FFFFFF;
    --color-surface-alt: #F8F7F4;
    --color-text: #222429;
    --color-text-muted: #666666;
    --color-border: #E5E7EB;
    --color-error: #DC2626;
    --color-success: #059669;
    --color-info: #3B82F6;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Radius & Shadows */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 1. Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
li,
figure,
figcaption,
blockquote,
dl,
dd {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

ul,
ol {
    list-style: none;
}

/* 2. Layout & Containers */
.container {
    width: min(1200px, calc(100% - 3rem));
    margin: 0 auto;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.section {
    padding: var(--space-12) 0;
}

.section-alt {
    background: var(--color-surface-alt);
}

/* 3. Typography */
h1,
h2,
h3,
h4 {
    line-height: 1.2;
    color: var(--color-brand-primary-dark);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
    font-weight: 700;
}

.eyebrow {
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-brand-accent);
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: var(--space-2);
}

.lead {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    max-width: 65ch;
}

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

/* 4. Components */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.button-primary {
    background: var(--color-brand-accent);
    color: #000;
}

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

.button-secondary {
    background: transparent;
    border-color: var(--color-brand-primary);
    color: var(--color-brand-primary);
}

.button-secondary:hover {
    background: var(--color-brand-primary);
    color: #fff;
}

.badge {
    display: inline-flex;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.badge-secondary {
    background: #e5e7eb;
    color: #374151;
}

.badge-highlight {
    background: #fef3c7;
    color: #92400e;
}

.alert {
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-6);
    border: 1px solid transparent;
}

.alert-error {
    background: #fef2f2;
    border-color: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background: #f0fdf4;
    border-color: #dcfce7;
    color: #166534;
}

.flash {
    position: fixed;
    top: var(--space-6);
    right: var(--space-6);
    z-index: 1000;
    width: min(400px, calc(100% - 2rem));
    padding: var(--space-4);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
    font-weight: 500;
}

.flash-info {
    background: #FDE68A; /* Amarillo/Dorado suave */
    color: #92400E;
    border-left: 4px solid #D97706;
}

.flash-success {
    background: #D1FAE5;
    color: #065F46;
    border-left: 4px solid #10B981;
}

.flash-error {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid #EF4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 5. Forms (Shared) */
.auth-wrap {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-alt);
    padding: var(--space-12) 0;
}

.auth-card {
    background: #fff;
    padding: var(--space-10);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: min(480px, 100%);
    border: 1px solid var(--color-border);
}

.auth-card h1,
.auth-card h2 {
    margin-bottom: var(--space-2);
}

.auth-card .helper {
    margin-bottom: var(--space-6);
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.stack-form {
    display: grid;
    gap: var(--space-4);
    max-width: 600px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
}

.full-width {
    grid-column: span 2;
}

.field {
    display: grid;
    gap: var(--space-2);
}

.field span {
    font-weight: 600;
    font-size: 0.875rem;
}

.field input,
.field select,
.field textarea {
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: #fff;
    transition: border-color 0.2s;
    width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--color-brand-accent);
    outline: none;
}

.field-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .full-width {
        grid-column: auto;
    }
}