/* Client room pages in the Ink and Gold kit (slice D10, D-042).
   Page-level styles for the entry, the deposit and withdrawal rooms and the unavailable page.
   Every value is a token from theme.css; kit parts (fk-*) come from /design-kit/kit.css.
   A room has no tab bar (mt5-parity.md, Client Portal): one task per page. */

/* The layout's page area follows the device theme on a client room page, so dark mode has no white frame. */
.fk-phone--layout:has(.cr-page) {
    background: var(--color-bg);
    color: var(--color-text);
    color-scheme: var(--theme-color-scheme);
}

.cr-page {
    display: grid;
    gap: var(--space-4);
    min-width: 0;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--text-md);
    line-height: var(--leading-body);
}

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

.cr-page :focus-visible {
    outline: var(--focus-ring);
    outline-offset: var(--focus-ring-offset);
}

.cr-page h1,
.cr-page h2,
.cr-page h3 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: var(--weight-display);
    letter-spacing: var(--display-tracking);
    line-height: var(--leading-tight);
    overflow-wrap: anywhere;
}

.cr-page h1 {
    font-size: var(--text-xl);
}

.cr-page h2 {
    font-size: var(--text-lg);
}

.cr-page h3 {
    font-size: var(--text-md);
}

.cr-page p,
.cr-page dl,
.cr-page dd,
.cr-page ol {
    margin: 0;
}

.cr-page p,
.cr-page dd {
    overflow-wrap: anywhere;
}

/* Heading row: the title and the state chip. The chip wraps under a long title on a narrow phone. */
.cr-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2) var(--space-3);
}

.cr-head > div {
    display: grid;
    gap: var(--space-1);
    min-width: 0;
}

.cr-eyebrow {
    color: var(--color-text-subtle);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: var(--wordmark-tracking);
    text-transform: uppercase;
}

/* A white card on the page background. */
.cr-card {
    display: grid;
    gap: var(--space-3);
    min-width: 0;
    padding: var(--space-4);
    border: var(--hairline);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-1);
}

/* "What to do now": the one card that says the client's next step, marked with the gold edge. */
.cr-next {
    display: grid;
    gap: var(--space-1);
    padding: var(--space-4);
    border: var(--hairline);
    border-inline-start: var(--space-1) solid var(--color-brand-gold-edge);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-1);
}

.cr-next__label {
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: var(--wordmark-tracking);
    text-transform: uppercase;
}

.cr-next__text {
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
}

.cr-hint {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

/* Label and value lines, as the kit's summary block: label left, value right and bold. */
.cr-lines > div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-1) var(--space-3);
    min-height: var(--row-height-1line);
    padding-block: var(--space-2);
    border-bottom: var(--hairline);
}

.cr-lines > div:last-child {
    border-bottom: 0;
}

.cr-lines dt,
.cr-lines > div > span:first-child {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

.cr-lines dd,
.cr-lines strong {
    min-width: 0;
    font-weight: var(--weight-bold);
    text-align: end;
}

.cr-figure {
    font-variant-numeric: var(--figure-variant);
    font-weight: var(--figure-weight);
}

.cr-lines .cr-note {
    flex-basis: 100%;
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-weight: var(--weight-regular);
    text-align: start;
}

/* Kit buttons fill the width on a phone, so the target is easy to hit. */
.cr-page .fk-btn {
    width: 100%;
    white-space: normal;
    text-align: center;
}

.cr-page .fk-field__input {
    min-height: var(--field-height);
}

/* The six-digit code: large, spaced figures. */
.cr-code {
    font-family: var(--font-mono);
    font-size: var(--text-xl);
    letter-spacing: var(--wordmark-tracking);
    text-align: center;
}

/* A file input as a large tappable drop area. */
.cr-file {
    width: 100%;
    min-height: var(--touch-target);
    padding: var(--space-3);
    border: 1px dashed var(--color-border-control);
    border-radius: var(--radius-md);
    background: var(--color-surface-sunken);
    color: var(--color-text);
    font: inherit;
    font-size: var(--text-sm);
}

.cr-file::file-selector-button {
    min-height: var(--touch-target);
    margin-inline-end: var(--space-3);
    padding: 0 var(--space-4);
    border: 1px solid var(--color-border-control);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-primary-text);
    font: inherit;
    font-weight: var(--weight-bold);
    cursor: pointer;
}

/* Feedback above the content uses the kit alert colours; its own role stays as the page set it. */
.cr-page .fk-alert {
    margin: 0;
    font-size: var(--text-md);
    font-weight: var(--weight-medium);
}

/* The progress list: a quiet vertical line with a dot per step. */
.cr-steps {
    display: grid;
    padding: 0;
    list-style: none;
}

.cr-steps li {
    position: relative;
    display: grid;
    gap: var(--space-1);
    padding: var(--space-2) 0 var(--space-2) var(--space-6);
    border-inline-start: 2px solid var(--color-border);
    margin-inline-start: var(--space-2);
}

.cr-steps li::before {
    position: absolute;
    top: calc(var(--space-2) + var(--space-1));
    inset-inline-start: calc(var(--space-2) * -1 + -1px);
    width: var(--space-4);
    height: var(--space-4);
    border: 2px solid var(--color-surface);
    border-radius: var(--radius-pill);
    background: var(--color-brand-gold-deep);
    content: "";
}

.cr-steps li:last-child {
    border-inline-start-color: transparent;
}

.cr-steps time {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-variant-numeric: var(--figure-variant);
}

.cr-support {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    text-align: center;
}

/* The safe error report partial sits inside a room: give it the card look. */
.cr-page [data-ui-error-report] {
    display: grid;
    gap: var(--space-2);
    border-color: var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

.cr-page [data-ui-report] {
    border: 1px solid var(--color-border-control);
    border-radius: var(--radius-sm);
    background: var(--color-surface-sunken);
    color: var(--color-text);
}

.cr-page [data-ui-report-copy] {
    border: 1px solid var(--color-border-control);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-primary-text);
    font-weight: var(--weight-bold);
}

/* The entry, the landing and the unavailable page: one centred card. */
.cr-gate {
    padding-block: var(--space-4);
}

.cr-gate .cr-card {
    gap: var(--space-4);
    padding: var(--space-6) var(--space-4);
}

.cr-gate__icon {
    display: grid;
    place-items: center;
    width: var(--space-8);
    height: var(--space-8);
    border-radius: var(--radius-pill);
    background: var(--color-primary-soft);
    color: var(--color-on-primary-soft);
}

.cr-gate__icon .fk-icon {
    width: var(--space-6);
    height: var(--space-6);
}

.cr-gate--held .cr-gate__icon {
    background: var(--status-held-bg);
    color: var(--status-held-fg);
}

@media (min-width: 600px) {
    .cr-gate .cr-card {
        padding: var(--space-7);
    }
}

/* The unavailable page keeps a bare paragraph for its message; it reads as the next step. */
.cr-gate .cr-card > h1 + p {
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
}

/* D-164: the failure page's own language links (plain GET, no form or token). */
.cr-gate__language {
    max-width: 16rem;
    margin-top: var(--space-4);
}
