/*
 * Base visual Órbita para la web pública.
 *
 * Los tokens proceden de DESIGN.md. El archivo vive en `public/` para que las
 * páginas públicas no dependan de Vite y compartan la misma base nocturna.
 */

:root {
    color-scheme: dark;
    --primary: #f5f7ff;
    --on-primary: #0b0d14;
    --neutral: #080a10;
    --surface: #131722;
    --surface-raised: #202637;
    --surface-input: #191e2b;
    --surface-glass: rgba(23, 29, 48, 0.88);
    --glass-border: rgba(185, 202, 255, 0.14);
    --on-surface: #f5f7ff;
    --secondary: #a5afc2;
    --tertiary: #a8b8ff;
    --rule: #30394c;
    --done: #69dfc0;
    --done-container: #102e2a;
    --attention: #f4c875;
    --attention-container: #33291a;
    --error: #ff93a4;
    --error-container: #351c26;
    --working: #a8b8ff;
    --working-container: #242c4d;
    --orbit-deep: #20346b;
    --orbit-mid: #6c83cc;
    --orbit-edge: #b9dced;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 9999px;
    --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: Unbounded, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --shadow-raised: 0 12px 36px rgba(0, 0, 0, 0.24);
}

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

html {
    min-width: 320px;
    scroll-behavior: smooth;
    background: var(--neutral);
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--neutral);
    color: var(--on-surface);
    font-family: var(--font);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: -0.01em;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--tertiary);
    text-underline-offset: 0.2em;
}

a:hover {
    color: var(--on-surface);
}

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

button,
a,
input,
select,
textarea,
summary {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 2px solid var(--tertiary);
    outline-offset: 3px;
}

svg {
    display: block;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

[hidden] {
    display: none !important;
}

.sheet {
    width: min(100% - 32px, 720px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 24px 0 40px;
}

.masthead {
    position: sticky;
    z-index: 10;
    top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    margin-bottom: 72px;
    padding: 8px 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    background: #171d30;
    box-shadow: var(--shadow-raised);
}

@supports ((-webkit-backdrop-filter: blur(20px)) or (backdrop-filter: blur(20px))) {
    .masthead {
        background: var(--surface-glass);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
    }
}

.wordmark {
    color: var(--on-surface);
    text-decoration: none;
}

.sheet > section {
    margin-bottom: 64px;
}

.sheet h1,
.sheet h2,
.sheet h3,
.sheet p,
.sheet ul,
.sheet ol,
.sheet dl {
    margin-top: 0;
}

h1 {
    max-width: 18ch;
    margin-bottom: 16px;
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

h2 {
    margin-top: 40px;
    margin-bottom: 12px;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

p,
li,
dd {
    color: var(--secondary);
}

.lede {
    max-width: 60ch;
    color: var(--on-surface);
    font-size: 18px;
    line-height: 1.55;
}

.small {
    font-size: 14px;
}

.quiet {
    color: var(--secondary);
}

.card {
    margin: 24px 0;
    padding: 24px;
    border-radius: var(--radius-lg);
    background: var(--surface);
}

.card > :last-child,
.note > :last-child {
    margin-bottom: 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: var(--on-primary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.button:hover {
    background: var(--tertiary);
    color: var(--on-primary);
}

.button:active {
    transform: translateY(1px);
}

.button.secondary {
    background: var(--surface-raised);
    color: var(--on-surface);
}

.button.secondary:hover {
    background: var(--rule);
}

.button.quiet-link {
    min-height: 44px;
    padding: 0 12px;
    background: transparent;
    color: var(--secondary);
}

.button.quiet-link:hover {
    color: var(--on-surface);
}

.field {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

label {
    color: var(--on-surface);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

input,
select,
textarea {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    background: var(--surface-input);
    color: var(--on-surface);
}

input::placeholder,
textarea::placeholder {
    color: var(--secondary);
    opacity: 1;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    border-color: var(--tertiary);
    outline: 2px solid var(--tertiary);
    outline-offset: 2px;
}

.field-error {
    margin: 0;
    color: var(--error);
    font-size: 14px;
}

.note {
    margin: 20px 0;
    padding: 16px;
    border-radius: var(--radius-md);
    background: var(--surface-input);
    color: var(--secondary);
    font-size: 14px;
}

.note.is-good {
    background: var(--done-container);
    color: var(--done);
}

.note.is-attention {
    background: var(--attention-container);
    color: var(--attention);
}

.note.is-error {
    background: var(--error-container);
    color: var(--error);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: var(--radius-pill);
    background: var(--surface-raised);
    color: var(--secondary);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.status-chip svg {
    width: 16px;
    height: 16px;
}

.status-chip.is-done {
    background: var(--done-container);
    color: var(--done);
}

.status-chip.is-attention {
    background: var(--attention-container);
    color: var(--attention);
}

.status-chip.is-working {
    background: var(--working-container);
    color: var(--working);
}

.entry {
    display: grid;
    grid-template-columns: minmax(96px, 0.35fr) 1fr;
    gap: 16px;
    padding: 12px 0;
}

.entry dt {
    color: var(--secondary);
    font-size: 13px;
    font-weight: 600;
}

.entry dd {
    min-width: 0;
    margin: 0;
    color: var(--on-surface);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.actions form {
    margin: 0;
}

.company-picker {
    display: grid;
    gap: 12px;
}

.rows {
    margin: 20px 0;
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    list-style: none;
}

.rows li + li {
    margin-top: 12px;
}

.colophon {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
    margin-top: 88px;
    padding: 24px 0;
    color: var(--secondary);
    font-size: 12px;
    line-height: 1.5;
}

.colophon nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.colophon a {
    color: var(--secondary);
}

.colophon a:hover {
    color: var(--on-surface);
}

@media (max-width: 560px) {
    .sheet {
        width: min(100% - 32px, 720px);
        padding-top: 16px;
    }

    .masthead {
        top: 8px;
        margin-bottom: 56px;
    }

    .card {
        padding: 20px;
    }

    .entry {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .actions,
    .actions form,
    .actions .button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
    }
}

.wordmark {
    display: inline-flex;
    align-items: center;
}

.brand-wordmark {
    width: 155px;
    height: 28px;
    fill: currentColor;
    stroke: none;
}

/* El alta: el paso a la app ------------------------------------------- */

.trap {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* El QR va negro sobre blanco aunque la página sea nocturna: las cámaras
   leen mal uno invertido. */
.handoff {
    display: flex;
    align-items: center;
    gap: 24px;
}

.handoff h2 {
    margin-top: 0;
}

.qr {
    flex: none;
    width: 168px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: #ffffff;
    line-height: 0;
}

.qr svg {
    width: 100%;
    height: auto;
    stroke: none;
}

/* `svg` lleva trazo y relleno de icono para toda la web; un QR no es un
   icono y cada módulo tiene que ser un cuadrado limpio. */
.qr svg path {
    stroke: none;
}

.login-code {
    margin: 4px 0 8px;
    color: var(--on-surface);
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 32px;
    font-weight: 600;
    letter-spacing: 0.08em;
    font-variant-numeric: tabular-nums;
}

/* En el móvil, el QR no sirve de nada: quien lo mira es el teléfono que lo
   tendría que escanear. */
@media (max-width: 560px) {
    .only-wide {
        display: none;
    }
}
