/* Pico handles most styling. --accent and --on-accent (readable text on the accent) are set per hotel in _Layout.
   Look: from the "HotelTips — Photo-led guest experience" Figma file (white paper, ink, one accent, 8px corners).
   Mobile-first: base rules are for phones, min-width media queries scale up. Light only for now:
   _Layout sets data-theme="light", and a dark palette hasn't been designed yet. */

/* Design tokens. :root[data-theme] matches Pico's own light-theme selector and comes later, so it wins. */
:root[data-theme="light"] {
    --paper: #ffffff;
    --ink: #252825;
    --muted: #70736e;
    --canvas: #f5f5f0;
    --border: #daddd6;
    --font-sans: "Plus Jakarta Sans", system-ui, "Segoe UI", sans-serif;
    --radius: 8px;
    --radius-card: 12px;
    --ease-arrive: cubic-bezier(0.22, 1, 0.36, 1);
    --duration-arrive: 700ms;
    --duration-respond: 120ms;

    --pico-font-family-sans-serif: var(--font-sans);
    --pico-background-color: var(--paper);
    --pico-color: var(--ink);
    --pico-muted-color: var(--muted);
    --pico-muted-border-color: var(--border);
    --pico-h1-color: var(--ink);
    --pico-h2-color: var(--ink);
    --pico-h3-color: var(--ink);
    --pico-h4-color: var(--ink);
    --pico-h5-color: var(--ink);
    --pico-h6-color: var(--muted);
    --pico-box-shadow: none;
    --pico-card-background-color: var(--paper);
    --pico-card-sectioning-background-color: var(--canvas);
    --pico-card-box-shadow: none;
    --pico-dropdown-background-color: var(--paper);
    --pico-dropdown-border-color: var(--border);
    --pico-table-border-color: var(--border);
    --pico-code-background-color: var(--canvas);
    --pico-mark-background-color: var(--canvas);
    --pico-mark-color: var(--ink);
    --pico-form-element-background-color: var(--paper);
    --pico-form-element-active-background-color: var(--paper);
    --pico-form-element-selected-background-color: var(--canvas);
    --pico-form-element-border-color: var(--muted);
    --pico-form-element-active-border-color: var(--ink);
    --pico-form-element-focus-color: rgba(37, 40, 37, 0.2);
    --pico-form-element-color: var(--ink);
    --pico-form-element-placeholder-color: var(--muted);
    --pico-secondary: var(--muted);
    --pico-secondary-background: var(--ink);
    --pico-secondary-border: var(--muted);
    --pico-secondary-underline: rgba(112, 115, 110, 0.4);
    --pico-secondary-hover: var(--ink);
    --pico-secondary-hover-background: var(--ink);
    --pico-secondary-hover-border: var(--ink);
    --pico-secondary-focus: rgba(112, 115, 110, 0.25);
    --pico-contrast: var(--ink);
    --pico-contrast-background: var(--ink);
    --pico-contrast-hover-background: #000;
    --pico-border-radius: var(--radius);
    --pico-transition: var(--duration-respond) ease-out;
}

/* Links and default buttons are ink; the accent (which can be any colour, even a pale one) is only for
   surfaces with --on-accent text. Pico defines its colors on :root with more specific selectors, so these go on body. */
body {
    --pico-primary: var(--ink);
    --pico-primary-background: var(--ink);
    --pico-primary-border: var(--ink);
    --pico-primary-inverse: var(--paper);
    --pico-primary-underline: rgba(37, 40, 37, 0.4);
    --pico-primary-hover: #000;
    --pico-primary-hover-background: #000;
    --pico-primary-hover-border: #000;
    --pico-primary-focus: rgba(37, 40, 37, 0.25);
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

body > main {
    flex: 1;
    width: 100%;
}

.container {
    padding-inline: 1.5rem;
}

/* Typography: one family. Hierarchy comes from size and space; nothing heavier than 600. */
h1, h2, h3 {
    font-weight: 600;
}

h1 {
    --pico-font-size: 1.625rem;
    --pico-line-height: 1.3;
}

h2 {
    --pico-font-size: 1.125rem;
    --pico-line-height: 1.45;
}

h3 {
    --pico-font-size: 1rem;
    --pico-line-height: 1.5;
}

h4, h5, h6, th, strong, b {
    font-weight: 600;
}

table {
    font-variant-numeric: tabular-nums;
}

/* Small labels for sections. */
.label {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--muted);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

article {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
}

/* Buttons: ink by default, .accent for the hotel's colour; a press answers within 120ms. */
button,
[role="button"],
[type="submit"],
[type="button"],
[type="reset"] {
    border-radius: var(--radius);
    font-weight: 500;
}

.accent {
    --pico-primary-background: var(--accent);
    --pico-primary-border: var(--accent);
    --pico-primary-inverse: var(--on-accent);
    --pico-primary-hover-background: color-mix(in srgb, var(--accent) 88%, var(--on-accent));
    --pico-primary-hover-border: color-mix(in srgb, var(--accent) 88%, var(--on-accent));
    --pico-primary-focus: color-mix(in srgb, var(--ink) 25%, transparent);
}

button:active,
[role="button"]:active,
[type="submit"]:active,
[type="button"]:active {
    transform: scale(0.97);
}

/* Motion: content the hotel shows arrives slowly; what the guest does is answered at once.
   Stagger with style="--i: n" (60ms per step). */
@keyframes arrive {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.arrive {
    animation: arrive var(--duration-arrive) var(--ease-arrive) both;
    animation-delay: calc(var(--i, 0) * 60ms);
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .arrive {
        animation: fade-in 200ms ease-out both;
    }

    button:active,
    [role="button"]:active,
    [type="submit"]:active,
    [type="button"]:active {
        transform: none;
    }
}

/* The dark header on every page: the hotel's logo (or name), language switch, signed-in nav. */
.site-header {
    --pico-primary: var(--paper);
    --pico-primary-hover: var(--paper);
    --pico-primary-underline: rgba(255, 255, 255, 0.5);
    --pico-primary-focus: rgba(255, 255, 255, 0.4);
    --pico-secondary: var(--paper);
    --pico-secondary-border: rgba(255, 255, 255, 0.5);
    --pico-secondary-hover: var(--paper);
    --pico-secondary-hover-border: var(--paper);
    --pico-secondary-underline: rgba(255, 255, 255, 0.5);
    --pico-secondary-focus: rgba(255, 255, 255, 0.4);
    background: var(--ink);
    color: var(--paper);
}

body > header.site-header {
    padding-block: 0;
}

.site-header nav {
    min-height: 4.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.site-header nav ul {
    flex-wrap: wrap;
    align-items: center;
}

.site-header nav ul:first-of-type > li {
    padding-block: 0.375rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    min-height: 3.75rem;
    color: var(--paper);
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
}

.brand img {
    display: block;
    width: auto;
    max-width: 10.75rem;
    max-height: 3.75rem;
    object-fit: contain;
}

.lang-switch {
    font-size: 0.875rem;
}

.lang-switch li {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0 0 0 0.25rem;
}

.lang-switch li + li::before {
    content: "/";
    float: none;
    color: var(--paper);
    opacity: 0.7;
}

.lang-switch a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    margin: 0;
    padding: 0 0.25rem;
    text-decoration: none;
    border-radius: 0;
}

.lang-switch a[aria-current] {
    font-weight: 600;
    text-decoration: underline;
}

.site-nav {
    flex-basis: 100%;
    padding-bottom: 0.5rem;
    font-size: 0.875rem;
}

.site-nav li {
    padding: 0.25rem 0.75rem 0.25rem 0;
}

.site-nav a {
    margin: 0;
    padding: 0.25rem 0;
}

.site-footer {
    padding: 1.5rem;
    background: var(--canvas);
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.5;
    text-align: center;
}

form.inline {
    margin: 0;
}

form.inline button {
    width: auto;
    margin: 0 0.25rem 0 0;
    padding: 0.35rem 0.8rem;
}

.avatar {
    width: 4.5rem;
    height: 4.5rem;
    flex-shrink: 0;
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    display: grid;
    place-items: center;
    object-fit: cover;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    font-size: 1.5rem;
}

article.narrow {
    max-width: 28rem;
    margin-inline: auto;
}

.avatar.small {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.9rem;
    margin: 0;
}

.staff-table td {
    vertical-align: middle;
}

.photo-field {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.photo-field .avatar {
    margin: 0;
}

.qr-preview {
    max-width: 18rem;
    margin: 0 auto;
    background: #fff;
    padding: 0.5rem;
    border-radius: var(--pico-border-radius);
}

.qr-preview svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Guest pages: one phone-width column on every screen size. */
.guest .site-header .container,
.guest main.container {
    max-width: 30rem;
    margin-inline: auto;
}

body.guest > main {
    padding-block: 0;
}

.guest-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-block: 1.5rem;
}

.guest-stack > * {
    margin: 0;
}

.guest-stack h1 {
    margin: 0;
}

.guest-stack p {
    margin: 0;
}

.supporting {
    margin-top: 0.5rem;
    color: var(--muted);
}

.guest-stack .supporting {
    margin-top: 0.5rem;
}

.guest main [role="button"],
.guest main [type="submit"] {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 3.25rem;
    margin: 0;
}

/* Runs edge to edge of the column, under the header. */
.guest-cover {
    display: block;
    width: calc(100% + 3rem);
    max-width: none;
    margin-inline: -1.5rem;
    aspect-ratio: 390 / 230;
    object-fit: cover;
}

input[type="search"][data-staff-search] {
    --pico-border-radius: var(--radius);
    height: 3rem;
    margin: 0;
}

.staff-directory h2 {
    margin: 0 0 0.75rem;
}

/* A department: plus/minus accordion with its staff and the team tip inside. */
.department {
    --pico-accordion-close-summary-color: var(--ink);
    --pico-accordion-active-summary-color: var(--ink);
    --pico-accordion-open-summary-color: var(--ink);
    margin: 0 0 0.5rem;
    border: 0;
    padding: 0;
}

.department > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 3.5rem;
    margin: 0;
    font-weight: 600;
    line-height: 1.5;
    color: var(--ink);
    list-style: none;
}

.department > summary::-webkit-details-marker {
    display: none;
}

.department > summary::after {
    display: none;
}

.department .icon-minus,
.department[open] .icon-plus {
    display: none;
}

.department[open] .icon-minus {
    display: block;
}

.department > summary img {
    flex-shrink: 0;
}

.department-staff {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 1rem;
}

.staff-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-block: 0.75rem;
    min-height: 4.5rem;
    color: var(--ink);
    text-decoration: none;
    transition: transform var(--duration-respond) ease-out;
}

.staff-row:active {
    transform: scale(0.98);
}

.staff-row .avatar {
    width: 3rem;
    height: 3rem;
    margin: 0;
    font-size: 1.05rem;
}

.staff-row-text {
    flex: 1;
    min-width: 0;
}

.staff-row-text strong {
    display: block;
    font-weight: 500;
    line-height: 1.5;
}

.staff-row-text small {
    display: block;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.43;
}

.staff-row-arrow {
    width: 1.5rem;
    font-size: 1.125rem;
    font-weight: 500;
    text-align: center;
}

@media (prefers-reduced-motion: reduce) {
    .staff-row:active {
        transform: none;
    }
}

/* Amount page. */
.recipient {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    padding-top: 1.5rem;
}

.recipient .avatar {
    width: 3.5rem;
    height: 3.5rem;
    margin: 0;
    font-size: 1.25rem;
}

.recipient-name {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.45;
}

.recipient-subtitle {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.43;
}

.tip-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-block: 1.5rem;
    margin: 0;
}

.tip-form h1 {
    margin: 0;
    font-size: 1.5625rem;
    line-height: 1.36;
}

.tip-form fieldset,
.tip-form label {
    margin: 0;
}

.tip-form fieldset {
    padding: 0;
    border: 0;
}

.field {
    display: flex;
    flex-direction: column;
}

.field > label {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.43;
}

.field label small {
    color: var(--muted);
    font-weight: 400;
}

.field input,
.field textarea {
    margin: 0.5rem 0 0;
}

.field input {
    height: 3rem;
}

.field textarea {
    min-height: 6.6875rem;
}

.tip-form .field > small,
.helper {
    display: block;
    margin-top: 0.25rem;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.5;
}

.amount-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem 0.625rem;
}

.amount-presets label {
    margin: 0;
    position: relative;
    width: auto; /* Pico shrinks labels with radios to fit-content */
}

.amount-presets input {
    position: absolute;
    opacity: 0;
    inset: 0;
    margin: 0;
}

.amount-presets span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3rem;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background-color var(--duration-respond) ease-out, color var(--duration-respond) ease-out,
        border-color var(--duration-respond) ease-out;
}

.amount-presets input:checked + span {
    background: var(--accent);
    border: 2px solid var(--ink);
    color: var(--on-accent);
}

.amount-presets input:focus-visible + span {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

.field-error {
    color: var(--pico-del-color);
}

/* The placeholder for a message takes no room until there is an error to show. */
.field > .field-error:not(:has(.field-validation-error)) {
    display: none;
}

/* Thank-you page. */
.thank-you {
    align-items: stretch;
}

.thank-you-heading {
    text-align: center;
}

.success-mark {
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    margin: 0 auto;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
}

/* The icon as a mask, so it takes the readable colour on any hotel's accent. */
.success-mark::before {
    content: "";
    width: 2rem;
    height: 2rem;
    background: currentColor;
    mask: url("../img/icons/check.svg") center / contain no-repeat;
}

.tip-receipt {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: none;
}

.tip-receipt-recipient {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tip-receipt .avatar {
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    font-size: 1rem;
}

.tip-receipt-recipient strong {
    display: block;
    line-height: 1.5;
}

.tip-receipt-recipient small {
    display: block;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.43;
}

.tip-receipt-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.875rem;
}

.tip-receipt-total strong {
    color: var(--ink);
    font-size: 1.375rem;
    line-height: 1.36;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.quiet-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    color: var(--ink);
    font-size: 0.875rem;
    text-align: center;
    text-decoration: none;
}

.settings-preview {
    max-height: 6rem;
    max-width: 100%;
    border-radius: var(--pico-border-radius);
    margin-bottom: 0.5rem;
}

.preset-inputs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.preset-inputs input {
    margin: 0;
}

.negative {
    color: var(--pico-del-color);
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.actions button {
    margin: 0;
}

.big-amount {
    font-size: 2.5rem;
    font-weight: 600;
    line-height: 1.1;
    margin: 0 0 0.5rem;
    font-variant-numeric: tabular-nums;
}

.totals article {
    margin: 0;
    padding: 0.75rem 1rem;
}

.totals header {
    margin: -0.75rem -1rem 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.filters {
    margin-bottom: 1rem;
}

/* Public landing page on the apex: arrival → how it works → what reaches staff → managers → trust → contact. */
.landing {
    max-width: 60rem;
    margin-inline: auto;
}

.landing .lede {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--muted);
    max-width: 36rem;
}

.landing h2 {
    --pico-font-size: clamp(1.5rem, 4vw, 2.25rem);
    --pico-line-height: 1.25;
    max-width: 34rem;
}

.landing-hero {
    padding: 3rem 0 4.5rem;
}

.landing-hero h1 {
    --pico-font-size: clamp(2.25rem, 7vw, 4rem);
    --pico-line-height: 1.1;
    max-width: 16ch;
    margin-bottom: 1.5rem;
}

.landing-hero [role="button"] {
    margin-top: 0.5rem;
    padding-inline: 2rem;
}

.landing-section {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
}

.landing-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 2.5rem;
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
}

.landing-steps li {
    counter-increment: step;
}

.landing-steps li::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 0.75rem;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    line-height: 1;
}

.landing-steps h3 {
    margin-bottom: 0.5rem;
}

.landing-steps p {
    margin: 0;
    color: var(--muted);
}

.landing-split,
.landing-contact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 3rem;
    align-items: start;
}

/* A thank-you note as staff see it: the emotional peak of the page. */
.landing-note {
    margin: 0;
    padding: 2rem;
    background: var(--canvas);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
}

.landing-note-amount {
    margin: 0 0 1rem;
    font-size: 2.25rem;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.landing-note blockquote {
    margin: 0 0 1.25rem;
    padding: 0;
    border: 0;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.4;
}

.landing-note figcaption {
    padding: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.landing-list,
.landing-trust {
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.landing-list li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 1.1rem;
    list-style: none;
}

.landing-trust {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem 2.5rem;
}

.landing-trust li {
    padding-top: 1rem;
    border-top: 2px solid var(--accent);
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.4;
    list-style: none;
}

.landing-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1.5rem;
    margin: 2rem 0 0;
}

.landing-details dt {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted);
    align-self: center;
}

.landing-details dd {
    margin: 0;
}

.landing-form button {
    width: auto;
    padding-inline: 2rem;
}

.landing-sent {
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--canvas);
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.4;
}

/* Off-screen rather than display:none, which some bots skip. */
.honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.landing-footer {
    padding: 2rem 0 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--muted);
}

.landing-footer p {
    margin: 0;
}
