/* Your View — Design System · B2 Ivory & Salvia
 * Tokens + utilities portados desde el rediseño.
 */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,300;1,9..144,400&family=Instrument+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* Palette */
    --yv-ivory: #F5F2E9;
    --yv-linen: #ECE8DA;
    --yv-paper: #FBF9F1;
    --yv-sage-1: #D4DBC5;
    --yv-sage-2: #B3BCA1;
    --yv-salvia: #6B7A5A;
    --yv-forest: #2E3A2A;
    --yv-ink: #1C1F19;
    --yv-ink-60: rgba(28, 31, 25, .60);
    --yv-ink-40: rgba(28, 31, 25, .40);
    --yv-ink-20: rgba(28, 31, 25, .18);
    --yv-ink-08: rgba(28, 31, 25, .08);

    --yv-terra: #A95A3A;
    --yv-honey: #C9A068;
    --yv-brick: #8C4A3C;

    /* Typography */
    --yv-serif: 'Fraunces', ui-serif, Georgia, serif;
    --yv-sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --yv-mono: 'JetBrains Mono', ui-monospace, monospace;

    /* Radii */
    --yv-r-sm: 10px;
    --yv-r-md: 14px;
    --yv-r-lg: 18px;
    --yv-r-xl: 22px;

    /* Shadows */
    --yv-shadow-1: 0 1px 0 rgba(28, 31, 25, .03), 0 12px 32px -20px rgba(46, 58, 42, .25);
    --yv-shadow-2: 0 2px 0 rgba(28, 31, 25, .04), 0 40px 80px -40px rgba(46, 58, 42, .35);
}

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

html, body {
    background: var(--yv-ivory);
    color: var(--yv-ink);
    font-family: var(--yv-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }

button { font-family: var(--yv-sans); }

/* -------- Typography utilities -------- */

.yv-display {
    font-family: var(--yv-serif);
    font-weight: 400;
    font-variation-settings: "opsz" 144, "SOFT" 50;
    letter-spacing: -0.02em;
    line-height: 1.02;
    color: var(--yv-ink);
}

.yv-display em {
    font-style: italic;
    font-weight: 300;
}

.yv-kicker {
    font-family: var(--yv-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--yv-ink-60);
}

.yv-body {
    font-family: var(--yv-sans);
    color: var(--yv-ink);
}

.yv-serif {
    font-family: var(--yv-serif);
    letter-spacing: -0.01em;
}

/* -------- Buttons -------- */

.yv-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--yv-sans);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, opacity .15s ease;
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
}

.yv-btn:hover { transform: translateY(-1px); }

.yv-btn .arrow {
    font-family: var(--yv-serif);
    font-style: italic;
    font-weight: 300;
    font-size: 17px;
}

.yv-btn-primary {
    background: var(--yv-forest);
    color: var(--yv-ivory);
}

.yv-btn-primary:hover { background: #223020; }

.yv-btn-secondary {
    background: transparent;
    color: var(--yv-ink);
    border-color: rgba(28, 31, 25, .22);
}

.yv-btn-secondary:hover { background: rgba(28, 31, 25, .04); }

.yv-btn-ghost {
    background: transparent;
    color: var(--yv-salvia);
}

.yv-btn-danger {
    background: transparent;
    color: var(--yv-terra);
    border-color: rgba(169, 90, 58, .3);
}

.yv-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* -------- Badges -------- */

.yv-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 11px 5px 9px;
    border-radius: 999px;
    font-family: var(--yv-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border: 1px solid currentColor;
}

.yv-badge .bead {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.yv-badge--easy   { color: var(--yv-salvia); }
.yv-badge--medium { color: #8A6A2C; }
.yv-badge--hard   { color: var(--yv-brick); }

/* -------- Photo placeholder -------- */

.yv-photo {
    position: relative;
    overflow: hidden;
    background: linear-gradient(170deg, var(--yv-sage-2) 0%, var(--yv-salvia) 55%, var(--yv-forest) 100%);
}

.yv-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 14px, transparent 14px 28px);
    pointer-events: none;
}

.yv-photo .tag {
    position: absolute;
    top: 12px;
    left: 12px;
    font-family: var(--yv-mono);
    font-size: 9.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .88);
    background: rgba(0, 0, 0, .22);
    backdrop-filter: blur(6px);
    padding: 5px 9px;
    border-radius: 999px;
    z-index: 2;
}

.yv-photo .caption {
    position: absolute;
    left: 14px;
    bottom: 12px;
    right: 14px;
    font-family: var(--yv-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .92);
    text-shadow: 0 1px 4px rgba(0, 0, 0, .35);
    z-index: 2;
}

/* -------- Form inputs -------- */

.yv-input,
.yv-select,
.yv-textarea {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--yv-ink-08);
    padding: 0 14px;
    font-family: var(--yv-sans);
    font-size: 15px;
    background: var(--yv-paper);
    color: var(--yv-ink);
    transition: border-color .15s ease;
}

.yv-input:focus,
.yv-select:focus,
.yv-textarea:focus {
    outline: none;
    border-color: var(--yv-salvia);
}

.yv-textarea {
    height: auto;
    min-height: 120px;
    padding: 12px 14px;
    line-height: 1.55;
    resize: vertical;
}

.yv-label {
    font-family: var(--yv-mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--yv-ink-60);
    display: block;
    margin-bottom: 6px;
}

/* -------- Pulsing live dot -------- */

.yv-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--yv-salvia);
    box-shadow: 0 0 0 4px rgba(107, 122, 90, .22);
}

.yv-dot--ivory {
    background: var(--yv-sage-1);
    box-shadow: 0 0 0 4px rgba(212, 219, 197, .25);
}

/* -------- Sidebar nav (admin/routes) -------- */

.yv-sidebar {
    background: var(--yv-paper);
    border-right: 1px solid var(--yv-ink-08);
    padding: 26px 20px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.yv-sidebar-brand {
    font-family: var(--yv-serif);
    font-size: 20px;
    letter-spacing: -0.01em;
}

.yv-sidebar-brand em {
    font-weight: 300;
    font-style: italic;
}

.yv-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
}

.yv-sidebar-nav a {
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--yv-ink);
    transition: background .15s ease;
    display: block;
}

.yv-sidebar-nav a:hover { background: var(--yv-ink-08); }

.yv-sidebar-nav a.active {
    background: var(--yv-forest);
    color: var(--yv-ivory);
}

.yv-sidebar-session {
    margin-top: auto;
    padding: 14px;
    border-radius: 14px;
    background: var(--yv-linen);
}

.yv-sidebar-session .name {
    font-family: var(--yv-serif);
    font-size: 16px;
}

.yv-sidebar-session .sub {
    font-size: 12px;
    color: var(--yv-ink-60);
}

/* -------- Toolbar (edit-route) -------- */

.yv-toolbar {
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--yv-ink-08);
    background: var(--yv-paper);
    gap: 16px;
    height: 60px;
}

/* -------- Cards -------- */

.yv-card {
    background: var(--yv-paper);
    border: 1px solid var(--yv-ink-08);
    border-radius: var(--yv-r-lg);
}

.yv-card--forest {
    background: var(--yv-forest);
    color: var(--yv-ivory);
    border: none;
}

.yv-card--forest .yv-kicker { color: rgba(245, 242, 233, .7); }

/* -------- Login split layout -------- */

.yv-login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--yv-ivory);
    color: var(--yv-ink);
}

@media (max-width: 900px) {
    .yv-login { grid-template-columns: 1fr; }
    .yv-login > .yv-photo { display: none; }
}

/* -------- Generic utilities -------- */

.yv-ink-60 { color: var(--yv-ink-60); }
.yv-ink-40 { color: var(--yv-ink-40); }

/* -------- Loading spinner -------- */

.yv-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid var(--yv-ink-08);
    border-top-color: var(--yv-salvia);
    border-radius: 50%;
    animation: yv-spin 0.9s linear infinite;
    margin: 0 auto;
}

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

/* -------- Alerts (for inline feedback) -------- */

.yv-alert {
    padding: 14px 18px;
    border-radius: var(--yv-r-md);
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-family: var(--yv-sans);
}

.yv-alert--success {
    background: rgba(107, 122, 90, .1);
    color: var(--yv-forest);
    border-color: rgba(107, 122, 90, .25);
}

.yv-alert--error {
    background: rgba(169, 90, 58, .08);
    color: var(--yv-terra);
    border-color: rgba(169, 90, 58, .25);
}

/* -------- Toasts -------- */

.yv-toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 340px;
    z-index: 1000;
    pointer-events: none;
}

.yv-toast {
    pointer-events: auto;
    background: var(--yv-ivory);
    border: 1px solid var(--yv-ink-08);
    border-left: 3px solid var(--yv-salvia);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--yv-shadow-1);
    display: flex;
    gap: 12px;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .25s ease, transform .25s ease;
}

.yv-toast.in { opacity: 1; transform: none; }

.yv-toast-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 7px;
    flex-shrink: 0;
    background: var(--yv-salvia);
}

.yv-toast-body { flex: 1; }
.yv-toast-title {
    font-size: 14px;
    font-family: var(--yv-serif);
}
.yv-toast-sub {
    font-size: 12px;
    color: var(--yv-ink-60);
    margin-top: 2px;
}
.yv-toast-close {
    margin-left: auto;
    color: var(--yv-ink-40);
    font-size: 14px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0 0 0 8px;
    align-self: flex-start;
}
.yv-toast-close:hover { color: var(--yv-ink); }

.yv-toast--success { border-left-color: var(--yv-salvia); }
.yv-toast--success .yv-toast-dot { background: var(--yv-salvia); }
.yv-toast--warning { border-left-color: var(--yv-honey); }
.yv-toast--warning .yv-toast-dot { background: var(--yv-honey); }
.yv-toast--error { border-left-color: var(--yv-terra); }
.yv-toast--error .yv-toast-dot { background: var(--yv-terra); }
.yv-toast--info { border-left-color: var(--yv-forest); }
.yv-toast--info .yv-toast-dot { background: var(--yv-forest); }

/* -------- Modal -------- */

.yv-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 31, 25, .45);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s ease;
}
.yv-modal-overlay.in { opacity: 1; }

.yv-modal {
    width: 460px; max-width: calc(100vw - 40px);
    background: var(--yv-ivory);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 40px 80px -20px rgba(28, 31, 25, .4);
    transform: translateY(12px);
    transition: transform .25s ease;
}
.yv-modal-overlay.in .yv-modal { transform: none; }

.yv-modal .kicker { margin-bottom: 10px; }
.yv-modal h3 {
    font-family: var(--yv-serif);
    font-size: 28px;
    letter-spacing: -0.01em;
    font-weight: 400;
    margin: 0 0 12px;
}
.yv-modal h3 em { font-style: italic; font-weight: 300; }
.yv-modal p {
    font-size: 14px;
    color: var(--yv-ink-60);
    line-height: 1.55;
    margin: 0 0 22px;
}
.yv-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.yv-btn--terra {
    background: var(--yv-terra);
    color: var(--yv-ivory);
    border: none;
}
.yv-btn--terra:hover { background: #8C4A3C; }

/* -------- Empty/Error states -------- */

.yv-state {
    background: var(--yv-paper);
    border: 1px solid var(--yv-ink-08);
    border-radius: var(--yv-r-lg);
    padding: 56px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.yv-state-title {
    font-family: var(--yv-serif);
    font-size: 24px;
    letter-spacing: -0.01em;
    font-weight: 400;
    color: var(--yv-ink);
}
.yv-state-title em { font-style: italic; font-weight: 300; }

.yv-state-body {
    font-size: 14px;
    color: var(--yv-ink-60);
    max-width: 360px;
    line-height: 1.55;
}

.yv-state-icon {
    width: 80px; height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

/* -------- Scrollbar -------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--yv-ink-08);
    border-radius: 10px;
    border: 2px solid var(--yv-ivory);
}
::-webkit-scrollbar-thumb:hover { background: var(--yv-ink-20); }
