/* EUS Room Bookings: shared UI (colors/fonts in themes.css) */

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

:root {
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --safe: env(safe-area-inset-bottom, 0px);
}

html { height: 100%; }

body {
    min-height: 100%;
    min-height: 100dvh;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--green);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

button { font: inherit; cursor: pointer; }

/* ── Gallery ── */

.rb-wrap {
    max-width: 880px;
    margin: 0 auto;
    padding: 32px 20px calc(40px + var(--safe));
}

.rb-header {
    margin-bottom: 36px;
}

.rb-header-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.rb-header-logo {
    width: 72px;
    height: auto;
    flex-shrink: 0;
    object-fit: contain;
}

.rb-header-text {
    min-width: 0;
}

.rb-header h1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.75rem, 4.5vw, 2.35rem);
    letter-spacing: -0.035em;
    line-height: 1.08;
    margin-bottom: 8px;
}

.rb-lead {
    font-size: 1.05rem;
    color: var(--ink-soft);
    max-width: 34ch;
}

@media (max-width: 480px) {
    .rb-header-row {
        gap: 14px;
    }

    .rb-header-logo {
        width: 56px;
    }
}

.rb-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 600px) {
    .rb-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
}

.rb-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: inherit;
    overflow: hidden;
    text-decoration: none;
    transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.rb-card:hover {
    border-color: var(--line-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.rb-card-photo {
    aspect-ratio: 16 / 10;
    background: var(--surface-muted);
    overflow: hidden;
}

.rb-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s var(--ease);
}

.rb-card:hover .rb-card-photo img { transform: scale(1.02); }

.rb-card-bundle {
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.rb-card-bundle .rb-collage {
    padding: 10px 8px;
    height: 100%;
}

.rb-card-bundle .rb-collage-piece img {
    aspect-ratio: 4 / 3;
}

.rb-card-bundle .rb-collage-cap {
    font-size: 0.62rem;
}

.rb-card-bundle .rb-collage-plus {
    font-size: 1.1rem;
    padding-bottom: 14px;
}

.rb-collage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    padding: 12px 10px;
    background: var(--surface-muted);
}

.rb-collage-large {
    padding: 14px 12px;
    min-height: 100%;
}

.rb-collage-piece {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rb-collage-piece img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.rb-collage-cap {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-align: center;
    line-height: 1.2;
}

.rb-collage-plus {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--green);
    flex-shrink: 0;
    padding-bottom: 18px;
}

.rb-collage-large .rb-collage-plus {
    font-size: 1.6rem;
    padding-bottom: 22px;
}

.rb-hero-photo-bundle {
    background: var(--surface-muted);
}

.rb-hero-photo-bundle .rb-collage {
    min-height: 100%;
}

.rb-sheet-confirm .rb-sheet-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 10px;
}

.rb-confirm-lead {
    font-size: 0.92rem;
    color: var(--ink-soft);
    line-height: 1.55;
    margin-bottom: 14px;
}

.rb-confirm-note {
    font-size: 0.82rem;
    color: var(--ink-muted);
    margin: 14px 0 16px;
    line-height: 1.5;
}

.rb-confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rb-confirm-actions .rb-btn {
    width: 100%;
    padding: 12px;
}

.rb-sheet-success {
    text-align: center;
}

.rb-success-mark {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border: 2px solid var(--green);
    border-radius: 50%;
    color: var(--green);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 48px;
}

.rb-success-details {
    margin: 14px 0 12px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    text-align: left;
}

.rb-success-room {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1rem;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.rb-success-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.rb-success-when {
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.rb-success-email {
    font-size: 0.88rem;
    color: var(--ink-muted);
    line-height: 1.55;
    margin-bottom: 18px;
    text-align: left;
}

.rb-card-body {
    padding: 16px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rb-card-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.rb-card-desc {
    font-size: 0.9rem;
    color: var(--ink-soft);
    line-height: 1.55;
    margin-bottom: 14px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rb-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 0.82rem;
    color: var(--ink-muted);
}

.rb-card-link {
    font-weight: 600;
    color: var(--green);
    white-space: nowrap;
}

/* ── Book page ── */

.rb-app {
    max-width: 560px;
    margin: 0 auto;
    padding-bottom: calc(72px + var(--safe));
}

.rb-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 18px 20px 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink-muted);
    text-decoration: none;
}

.rb-back:hover { color: var(--ink); }

.rb-hero-photo {
    margin: 14px 20px 0;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface-muted);
}

.rb-hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rb-intro {
    padding: 20px 20px 0;
}

.rb-intro h1 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.45rem;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
}

.rb-intro p {
    font-size: 0.92rem;
    color: var(--ink-soft);
    line-height: 1.55;
    margin-bottom: 8px;
}

.rb-facts {
    font-size: 0.82rem;
    color: var(--ink-muted);
}

.rb-panel {
    padding: 22px 20px;
}

.rb-week-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 14px;
}

.rb-nav { display: flex; gap: 6px; }

.rb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .rb-btn:hover {
        background: var(--ink);
        border-color: var(--ink);
        color: var(--paper);
    }

    .rb-btn-quiet:hover {
        background: var(--surface);
        border-color: var(--line-strong);
        color: var(--ink);
    }
}

.rb-btn:active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.rb-btn-quiet {
    border-color: var(--line);
    color: var(--ink-soft);
    background: transparent;
}

.rb-btn-quiet:active {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--ink);
}

.rb-week-range {
    flex: 1;
    text-align: center;
    font-size: 0.78rem;
    color: var(--ink-muted);
}

.rb-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 16px;
}

.rb-day {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 9px 2px;
    min-height: 56px;
    min-width: 0;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s, background 0.15s;
}

.rb-day .dow {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 3px;
}

.rb-day .num {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
}

@media (max-width: 400px) {
    .rb-days { gap: 3px; }
    .rb-day {
        padding: 8px 1px;
        min-height: 50px;
    }
    .rb-day .dow {
        font-size: 0.58rem;
        letter-spacing: 0.02em;
    }
    .rb-day .num { font-size: 0.88rem; }
    .rb-week-bar { gap: 4px; }
    .rb-week-range { font-size: 0.7rem; }
}

.rb-day.active {
    background: var(--green);
    border-color: var(--green);
    color: var(--on-accent);
}

.rb-day.active .dow { color: color-mix(in srgb, var(--on-accent) 70%, transparent); }

.rb-day.today:not(.active) {
    border-color: var(--green);
    box-shadow: inset 0 0 0 1px var(--green);
}

.rb-hint-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--ink-soft);
}

.rb-hint-row .until {
    font-size: 0.78rem;
    color: var(--ink-muted);
}

.rb-page-error {
    display: none;
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid rgba(154, 61, 46, 0.25);
    color: var(--warn);
    font-size: 0.9rem;
    background: var(--warn-bg);
}

.rb-page-error.show { display: block; }

.rb-times {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rb-times.is-loading { pointer-events: none; }

.rb-time {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 50px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: left;
    color: var(--ink);
    transition: border-color 0.15s, background 0.15s;
}

.rb-time:disabled {
    background: var(--surface-muted);
    color: var(--ink-muted);
    cursor: not-allowed;
    opacity: 0.75;
}

.rb-time .label { font-weight: 600; font-size: 0.95rem; }

.rb-time .meta { font-size: 0.78rem; color: var(--ink-muted); }

@media (hover: hover) {
    .rb-time.open:hover {
        border-color: var(--green);
        background: var(--green-tint);
    }
}

.rb-time.open:active {
    border-color: var(--green);
    background: var(--green-tint);
}

.rb-time.selected {
    border-color: var(--green);
    background: var(--green-tint);
    box-shadow: inset 3px 0 0 var(--green);
}

.rb-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--ink-muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* ── Shared sections ── */

.rb-mine {
    margin-top: 8px;
    padding: 20px 20px 0;
    border-top: 1px solid var(--line);
}

.rb-mine h2 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.rb-mine ul { list-style: none; }

.rb-mine li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.rb-mine li:last-child { border-bottom: 0; }

.rb-mine .title { font-weight: 600; font-size: 0.92rem; margin-bottom: 2px; }

.rb-mine .when {
    font-size: 0.78rem;
    color: var(--ink-muted);
    line-height: 1.4;
}

.rb-foot {
    margin-top: 32px;
    font-size: 0.8rem;
    color: var(--ink-muted);
    line-height: 1.65;
}

.rb-credit {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 0.78rem;
    color: var(--ink-muted);
    text-align: center;
}

.rb-credit a {
    color: var(--ink-soft);
    font-weight: 600;
    text-decoration: none;
}

.rb-credit a:hover {
    color: var(--green);
    text-decoration: underline;
}

.rb-app .rb-credit {
    margin: 28px 20px 24px;
}

.rb-equipment {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.rb-equipment h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.rb-equipment-lead {
    font-size: 0.88rem;
    color: var(--ink-soft);
    margin-bottom: 16px;
}

.rb-equip-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 600px) {
    .rb-equip-grid { grid-template-columns: 1fr 1fr; }
}

.rb-equip-card {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 0.84rem;
    color: var(--ink-soft);
    line-height: 1.55;
}

.rb-equip-card h3 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 8px;
}

.rb-equip-card ul {
    padding-left: 1.1rem;
}

.rb-equip-card li { margin-bottom: 4px; }

.rb-equip-cta {
    margin-top: 14px;
    font-size: 0.84rem;
    color: var(--ink-muted);
}

.rb-rules-note,
.rb-rules-warn {
    margin-top: 10px;
    font-size: 0.8rem;
    line-height: 1.5;
}

.rb-rules-warn {
    color: var(--warn);
}

/* ── Modal ── */

.rb-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
}

.rb-modal-bg {
    position: absolute;
    inset: 0;
    background: var(--modal-overlay);
    border: 0;
    cursor: pointer;
}

.rb-sheet {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    max-height: min(92dvh, 720px);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
    padding: 20px 20px calc(20px + var(--safe));
}

@media (min-width: 600px) {
    .rb-modal { align-items: center; padding: 24px; }
    .rb-sheet {
        border-radius: var(--radius);
        border-bottom: 1px solid var(--line-strong);
        box-shadow: 0 24px 64px rgba(26, 23, 20, 0.14);
    }
}

.rb-sheet-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
}

.rb-sheet-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
}

.rb-sheet-sub {
    font-size: 0.82rem;
    color: var(--ink-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.rb-section-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-muted);
    margin-bottom: 8px;
}

.rb-durs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.rb-dur {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-soft);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.rb-dur.active {
    background: var(--green);
    border-color: var(--green);
    color: var(--on-accent);
}

.rb-field { margin-bottom: 12px; }

.rb-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 5px;
}

.rb-field input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    font-size: 16px;
    color: var(--ink);
    transition: border-color 0.15s;
}

.rb-field input:focus {
    outline: none;
    border-color: var(--green);
}

.rb-field-hint {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--ink-muted);
    line-height: 1.45;
}

.rb-cancel-card {
    padding: 22px 20px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
}

.rb-cancel-room {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.2rem;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.rb-cancel-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.rb-cancel-when {
    color: var(--ink-soft);
    margin-bottom: 14px;
}

.rb-cancel-note {
    font-size: 0.88rem;
    color: var(--ink-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}

.rb-cancel-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rb-cancel-back {
    text-align: center;
    text-decoration: none;
}

.rb-rules {
    margin: 14px 0;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--paper);
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--ink-soft);
    max-height: 220px;
    overflow-y: auto;
}

.rb-rules ol { padding-left: 1.15rem; }

.rb-rules li { margin-bottom: 3px; }

.rb-rules .highlight {
    background: var(--highlight);
    padding: 0 2px;
}

.rb-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.88rem;
    line-height: 1.45;
    margin-bottom: 10px;
    cursor: pointer;
    color: var(--ink-soft);
}

.rb-check input {
    margin-top: 3px;
    accent-color: var(--green);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.rb-modal-error {
    color: var(--warn);
    font-size: 0.88rem;
    min-height: 1.2em;
    margin: 8px 0;
}

.rb-btn-primary {
    width: 100%;
    padding: 13px;
    border: 0;
    border-radius: var(--radius);
    background: var(--green);
    color: var(--on-accent);
    font-size: 0.95rem;
    font-weight: 600;
    transition: background 0.15s;
}

.rb-btn-primary:hover:not(:disabled) { background: var(--green-hover); }

.rb-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

body.rb-modal-open { overflow: hidden; }
