/* The entry pages: the PIN screen, the link errors and the goodbye page. They
   share one card because they are the same moment for the patient — the step
   before the forms — and someone who mistypes a PIN should not feel they have
   landed somewhere else.

   Global rather than scoped: three components draw this card, and Blazor scopes
   CSS per component. Colour comes from the tokens in app.css, so these pages
   stay in step with the forms. */

.gate {
    display: flex;
    justify-content: center;
    padding: 24px 0 48px;
}

.gate-card {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    padding: 32px 28px 24px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    /* Soft and low: this is a resting surface, not something being dragged. */
    box-shadow: 0 1px 2px rgba(23, 50, 77, 0.04), 0 8px 24px rgba(23, 50, 77, 0.06);
    text-align: center;
}

.gate-logo {
    display: block;
    height: 40px;
    width: auto;
    margin: 0 auto 20px;
}

.gate-title {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.gate-lede {
    margin: 0 0 24px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.gate-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.9rem;
    color: var(--error-color);
    background: var(--error-soft);
    border: 1px solid var(--error-border);
    border-radius: 10px;
}

.gate-field {
    margin-bottom: 20px;
    text-align: left;
}

/* .gate-field is the mud-input-control itself, and MudBlazor's own border rule
   outranks a single class, so match its depth to round the field to the card's
   radius. The focus colour is left to the theme: it is already brand red. */
.gate-field .mud-input.mud-input-outlined .mud-input-outlined-border {
    border-radius: 10px;
}

/* Continue matches the app's default primary action (.btn.primary in
   intake-form.css): teal accent, pill shape, no uppercase. */
.gate-continue.mud-button-root {
    height: 48px;
    border-radius: 999px;
    background-color: var(--accent-color);
    color: var(--on-accent);
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
}

    .gate-continue.mud-button-root:hover {
        background-color: var(--accent-ink);
        box-shadow: none;
    }

    .gate-continue.mud-button-root:disabled {
        background-color: var(--accent-color);
        color: var(--on-accent);
        opacity: .65;
    }

.gate-foot {
    margin: 20px 0 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

/* ---------- Waiting on the link check ---------- */

.gate-wait {
    padding: 48px 28px;
}

.gate-wait-text {
    margin: 16px 0 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

@media (max-width: 480px) {
    .gate {
        padding: 12px 0 32px;
    }

    .gate-card {
        padding: 28px 20px 20px;
    }
}

/* ---------- Link errors and sign-out ---------- */

.gate-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    color: var(--primary-color);
    background: var(--primary-light);
}

.gate-msg {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-secondary);
}

/* The 404 is the one page with no patient context, so the number carries it. */
.gate-code {
    margin: 0 0 4px;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary-color);
}

/* ---------- Language switch under the PIN card ---------- */

.gate-lang {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 6px 12px;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

    .gate-lang:hover {
        color: var(--accent-ink);
        border-color: var(--accent-ink);
    }

    .gate-lang:focus-visible {
        outline: 2px solid var(--accent-ink);
        outline-offset: 2px;
    }
