/* Restroom Readiness product page. Builds on site.css and the shared product page pieces in time.css.
   Colour roles: green is service verified and an issue fixed, amber is a visitor's report waiting on a
   response, and blue is the team being notified. The public page reads as a web page, not an app. */

/* Hero figure: the restroom's public QR page beside what happens behind it */

.rr-figure {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 0 var(--line), 0 24px 48px -24px rgba(20, 33, 61, 0.28);
    overflow: hidden;
}

.rr-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}

.rr-stage {
    display: grid;
    grid-template-columns: 228px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    padding: 22px;
    background: var(--base);
}

/* The visitor's phone: a fixed dark bezel, so it stays a device in both themes */
.rr-phone {
    padding: 9px;
    border-radius: 30px;
    background: #1b2333;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 18px 36px -20px rgba(20, 33, 61, 0.5);
}

.rr-screen {
    min-height: 430px;
    padding: 16px 16px 18px;
    border-radius: 22px;
    background: var(--surface);
    font-size: 0.85rem;
}

.rr-scanned {
    display: inline-block;
    margin-bottom: 14px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--base);
    font-size: 0.7rem;
    color: var(--ink-soft);
}

.rr-name {
    font-variation-settings: "wdth" 118;
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.1;
}

.rr-where {
    color: var(--ink-soft);
    font-size: 0.8rem;
}

.rr-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: var(--verified-soft);
    color: var(--verified);
    font-weight: 700;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Ready is a tick in a filled circle */
.rr-status-mark {
    position: relative;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: currentColor;
}

.rr-status-mark::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 3px;
    width: 4px;
    height: 8px;
    border: solid var(--surface);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* An open report is an exclamation mark */
.rr-status.is-reported {
    background: var(--escalate-soft);
    color: var(--escalate);
}

.rr-status.is-reported .rr-status-mark::after {
    content: "!";
    left: 0;
    top: 0;
    width: 18px;
    height: 18px;
    border: 0;
    transform: none;
    color: var(--surface);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

.rr-last {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.rr-last dt {
    color: var(--ink-soft);
}

.rr-last dd {
    font-variation-settings: "wdth" 112;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 1.2rem;
}

.rr-checked {
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--ink-soft);
}

.rr-report {
    margin-top: 16px;
}

.rr-report-q {
    font-weight: 600;
}

.rr-report-btn {
    display: block;
    margin-top: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1.5px solid var(--signal);
    color: var(--signal);
    font-weight: 700;
    text-align: center;
    transition: background 0.25s ease, color 0.25s ease;
}

.rr-report.is-pressed .rr-report-btn {
    background: var(--signal);
    color: var(--surface);
}

.rr-report-pick {
    display: none;
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--escalate);
    background: var(--escalate-soft);
    color: var(--escalate);
    font-weight: 650;
    font-size: 0.8rem;
}

.rr-report.is-pressed .rr-report-pick {
    display: block;
}

.rr-recent {
    margin-top: 14px;
    font-size: 0.78rem;
    color: var(--verified);
    font-weight: 600;
}

.rr-recent.is-open {
    color: var(--escalate);
}

/* Behind the page: the event feed */

.rr-feed-title {
    margin-bottom: 10px;
    font-weight: 650;
}

.rr-events {
    display: grid;
    gap: 4px;
}

.rr-event {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    column-gap: 10px;
    align-items: start;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 0.85rem;
    font-weight: 600;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.rr-event.is-pending {
    opacity: 0;
    transform: translateY(6px);
}

.rr-detail {
    display: block;
    font-weight: 400;
    font-size: 0.76rem;
    color: var(--ink-soft);
}

.rr-time {
    font-variant-numeric: tabular-nums;
    color: var(--ink-soft);
}

.rr-mark {
    position: relative;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--verified);
}

/* Done: a tick */
.rr-event.is-done .rr-mark::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 3px;
    width: 4px;
    height: 8px;
    border: solid var(--surface);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* A report: an exclamation mark */
.rr-event.is-flag .rr-mark {
    background: var(--escalate);
}

.rr-event.is-flag .rr-mark::after {
    content: "!";
    position: absolute;
    inset: 0;
    color: var(--surface);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
}

/* A notification: a hollow ring */
.rr-event.is-alert .rr-mark {
    background: none;
    box-shadow: inset 0 0 0 2.5px var(--signal);
}

.rr-event.is-flag {
    border-color: var(--escalate);
}

/* Solution: the cleaner's verified service checklist */

.svc-card,
.history {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--base);
    overflow: hidden;
}

.svc-who {
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    font-size: 0.88rem;
    color: var(--ink-soft);
}

.svc-tag {
    margin-right: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--verified-soft);
    color: var(--verified);
    font-size: 0.78rem;
    font-weight: 700;
}

.svc-rows li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 60px;
    column-gap: 14px;
    align-items: center;
    padding: 11px 20px;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}

.svc-name {
    display: flex;
    flex-direction: column;
    font-weight: 600;
}

.svc-name small {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.svc-ok {
    padding: 2px 0;
    border-radius: 999px;
    background: var(--verified-soft);
    color: var(--verified);
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
}

.svc-rows li.is-flag {
    background: var(--escalate-soft);
}

.svc-rows li.is-flag .svc-ok {
    background: var(--escalate);
    color: var(--surface);
}

.svc-note {
    padding: 14px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--escalate);
}

/* Scenario: one restroom's service history for the morning */

.history-rows li {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    column-gap: 14px;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}

.history-rows li:last-child {
    border-bottom: 0;
}

.history-rows li.is-flag {
    background: var(--escalate-soft);
}

.h-time {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.h-what {
    display: flex;
    flex-direction: column;
    font-weight: 600;
}

.h-what small {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--ink-soft);
}

.h-state {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.h-state.is-done {
    background: var(--verified-soft);
    color: var(--verified);
}

.h-state.is-flag {
    background: var(--escalate);
    color: var(--surface);
}

/* Responsive */

@media (max-width: 640px) {
    .rr-stage {
        grid-template-columns: minmax(0, 1fr);
        padding: 16px;
    }

    .rr-phone {
        width: 100%;
        max-width: 260px;
        margin: 0 auto;
    }

    .rr-screen {
        min-height: 0;
    }

    .rr-head {
        padding-left: 16px;
        padding-right: 16px;
    }

    .svc-rows li,
    .history-rows li,
    .svc-who,
    .svc-note {
        padding-left: 16px;
        padding-right: 16px;
    }

    .history-rows li {
        grid-template-columns: 46px minmax(0, 1fr);
        row-gap: 6px;
    }

    .h-state {
        grid-column: 2;
        justify-self: start;
    }
}
