/* ==========================================================================
   Bruma · base compartida
   ========================================================================== */

@font-face {
    font-family: 'Instrument Serif';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/instrument-serif.woff2') format('woff2');
}
@font-face {
    font-family: 'Instrument Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/instrument-serif-italic.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-latin.woff2') format('woff2');
}

:root {
    --paper: #f6f2ec;
    --paper-2: #efe8de;
    --paper-3: #e7ddcf;
    --white: #fffdf9;
    --ink: #1d1b18;
    --ink-2: #3b3833;
    --muted: #7b7469;
    --muted-2: #9a9286;
    --line: #ddd5c8;
    --line-strong: #c9bfae;
    --forest: #3f5547;
    --forest-deep: #2c3e33;
    --forest-soft: #e5ebe3;
    --sage: #a9b8a6;
    --clay: #b56d4f;
    --amber: #b9833f;
    --amber-bg: #f9efdf;
    --blue: #52698a;
    --blue-bg: #e9eef6;
    --danger: #9b4c3e;
    --danger-bg: #f6e5df;
    --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --shadow-sm: 0 1px 2px rgba(36, 30, 22, .05);
    --shadow-md: 0 10px 30px -12px rgba(45, 38, 27, .18);
    --shadow-lg: 0 30px 60px -30px rgba(45, 38, 27, .3);
    --radius: 14px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 92px;
}

body {
    margin: 0;
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: .028;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p, dl, dd, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
em { font-style: italic; }
::selection { background: var(--forest); color: var(--paper); }

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

.container {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 36px;
}

/* ---------- Marca y textos ---------- */
.wordmark {
    display: inline-flex;
    align-items: baseline;
    font-family: var(--serif);
    font-size: 31px;
    line-height: 1;
    letter-spacing: -.02em;
    color: var(--ink);
    white-space: nowrap;
}
.wordmark span { color: var(--clay); }
.wordmark--light { color: var(--paper); }
.wordmark--sm { font-size: 24px; }

.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--muted);
}
.eyebrow--dot::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--clay);
}
.eyebrow--light { color: rgba(244, 239, 231, .62); }

.serif { font-family: var(--serif); font-weight: 400; }

.link-underline {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .03em;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--line-strong);
    transition: border-color .2s, color .2s;
}
.link-underline:hover { border-color: var(--ink); }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .025em;
    line-height: 1;
    white-space: nowrap;
    transition: background .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }

.btn--primary {
    background: var(--forest);
    border-color: var(--forest);
    color: #f8f4ed;
    box-shadow: 0 8px 18px -12px rgba(44, 62, 51, .8);
}
.btn--primary:hover { background: var(--forest-deep); border-color: var(--forest-deep); }
.btn--ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--ink);
}
.btn--ghost:hover { border-color: var(--ink); background: rgba(255, 255, 255, .4); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff7f2; }
.btn--danger:hover { background: #833d32; border-color: #833d32; }
.btn--sm { height: 36px; padding: 0 16px; font-size: 11.5px; }
.btn--block { width: 100%; height: 50px; }
.btn-arrow { font-size: 14px; line-height: 1; }

.btn--danger-ghost {
    background: transparent;
    border-color: #dcc0b8;
    color: var(--danger);
}
.btn--danger-ghost:hover { background: var(--danger-bg); border-color: var(--danger); }

.text-btn {
    background: none;
    border: 0;
    padding: 0;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    line-height: 1.7;
}
.text-btn:hover { color: var(--ink); border-color: var(--ink); }

.circle-btn {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--white);
    color: var(--ink-2);
    font-size: 13px;
    transition: border-color .2s, background .2s;
}
.circle-btn:hover { border-color: var(--ink); }

.icon-btn {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--ink-2);
    font-size: 18px;
    line-height: 1;
    transition: background .2s, border-color .2s;
}
.icon-btn:hover { background: rgba(29, 27, 24, .06); }
.icon-btn svg { width: 19px; height: 19px; }

/* ---------- Campos ---------- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field--full { grid-column: 1 / -1; }
.field > span {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}
.field > span em { color: var(--clay); font-style: normal; }
.field > span small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted-2); }
.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--white);
    font-size: 13.5px;
    color: var(--ink);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.field textarea { resize: vertical; min-height: 82px; line-height: 1.5; }
.field input::placeholder,
.field textarea::placeholder { color: #b3aa9d; }
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 0;
    border-color: var(--forest);
    box-shadow: 0 0 0 3px rgba(63, 85, 71, .12);
}
.field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237b7469' stroke-width='1.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 34px;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
    cursor: pointer;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin-top: 1px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: var(--white);
    display: grid;
    place-items: center;
    transition: background .2s, border-color .2s;
}
.check__box::after {
    content: '';
    width: 8px;
    height: 5px;
    border-left: 1.5px solid #fff;
    border-bottom: 1.5px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
    opacity: 0;
}
.check input:checked + .check__box { background: var(--forest); border-color: var(--forest); }
.check input:checked + .check__box::after { opacity: 1; }
.check input:focus-visible + .check__box { outline: 2px solid var(--forest); outline-offset: 2px; }
.check strong { color: var(--ink-2); font-weight: 600; }

.form-error {
    min-height: 18px;
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--danger);
}
.form-error:empty { display: none; }

.fineprint {
    margin-top: 12px;
    text-align: center;
    font-size: 10.5px;
    color: var(--muted-2);
}

/* ---------- Pills / counts / dots ---------- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    white-space: nowrap;
}
.status-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill--pending { background: var(--amber-bg); color: #855c23; }
.status-pill--confirmed { background: var(--forest-soft); color: #33503d; }
.status-pill--reschedule { background: var(--blue-bg); color: #435775; }
.status-pill--cancel { background: var(--danger-bg); color: #7f4335; }
.status-pill--cancelled { background: #ece8e1; color: #7d766a; }
.status-pill--completed { background: #eeeae2; color: #6b6458; }

.count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--paper-3);
    color: var(--ink-2);
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot--confirmed { background: #5f8068; }
.dot--pending { background: #c08a43; }
.dot--reschedule { background: #647d9f; }
.dot--cancel { background: #b56d4f; }

/* ---------- Avatar ---------- */
.avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--forest);
    color: #f7f2e9;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .04em;
}
.avatar--lg { width: 42px; height: 42px; font-size: 11.5px; }

/* ---------- Diálogos ---------- */
dialog {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
}
dialog::backdrop {
    background: rgba(28, 24, 18, .38);
    backdrop-filter: blur(4px);
}
dialog[open] { animation: dialog-in .25s cubic-bezier(.2, .7, .3, 1); }

@keyframes dialog-in {
    from { opacity: 0; transform: translateY(10px) scale(.985); }
    to { opacity: 1; transform: none; }
}

.modal-close {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 17px;
    line-height: 1;
    transition: border-color .2s, color .2s;
}
.modal-close:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 2000;
    transform: translate(-50%, 14px);
    padding: 12px 18px;
    border-radius: 10px;
    background: var(--ink);
    color: var(--paper);
    font-size: 12px;
    line-height: 1.4;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    max-width: min(440px, calc(100vw - 32px));
    text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--danger); }

/* ---------- Reveal ---------- */
.will-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .7s cubic-bezier(.2, .7, .3, 1), transform .7s cubic-bezier(.2, .7, .3, 1);
}
.will-reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    .will-reveal { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
    .container { padding: 0 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .field--full { grid-column: auto; }
    .btn { height: 44px; padding: 0 18px; }
}
