/* TopScorePlus - base.css
   Reset, variables y primitivos. Mobile-first.
   Cargado por todas las pantallas (landing, app, juez). */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

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

button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; line-height: 1.2; color: var(--color-heading); font-weight: 700; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

:root {
    --color-bg:        #f7f9fc;
    --color-surface:   #ffffff;
    --color-surface-2: #f1f5f9;
    --color-text:      #0f172a;
    --color-text-mute: #475569;
    --color-heading:   #0f172a;
    --color-border:    #e2e8f0;

    --color-primary:        #2563eb;
    --color-primary-hover:  #1d4ed8;
    --color-primary-soft:   #dbeafe;
    --color-accent:         #7c3aed;
    --color-success:        #16a34a;
    --color-warning:        #d97706;
    --color-danger:         #dc2626;

    --radius-sm: 6px;
    --radius:    12px;
    --radius-lg: 18px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow:    0 6px 20px rgba(15, 23, 42, .08);
    --shadow-lg: 0 14px 40px rgba(15, 23, 42, .12);

    --container: 1180px;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform .08s ease, background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
    line-height: 1;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--color-primary-hover); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn--ghost:hover { background: var(--color-surface-2); text-decoration: none; }
.btn--lg { padding: 1rem 1.6rem; font-size: 1rem; }
.btn--block { width: 100%; }

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.flash {
    padding: .85rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-weight: 500;
    font-size: .95rem;
}
.flash--success { background: #dcfce7; color: #14532d; }
.flash--error   { background: #fee2e2; color: #7f1d1d; }
.flash--info    { background: #dbeafe; color: #1e3a8a; }

.input,
.select,
.textarea {
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    font: inherit;
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus,
.select:focus,
.textarea:focus {
    outline: 0;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: .35rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    background: var(--color-surface-2);
    color: var(--color-text-mute);
}
.badge--primary { background: var(--color-primary-soft); color: var(--color-primary-hover); }
.badge--success { background: #dcfce7; color: #14532d; }
.badge--warning { background: #fef3c7; color: #92400e; }
.badge--danger  { background: #fee2e2; color: #7f1d1d; }

.error-page {
    min-height: 70vh;
    display: grid;
    place-items: center;
    padding: 3rem 1rem;
}
.error-page__inner {
    text-align: center;
    max-width: 520px;
}
.error-page__code {
    font-size: 5rem;
    font-weight: 800;
    color: var(--color-primary);
    margin: 0;
    line-height: 1;
}
.error-page__inner h1 { margin-top: .5rem; }
.error-page__actions {
    display: flex;
    gap: .75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
