/*
 * PlattuIDM — a small amount of styling on top of Bootstrap 5.
 *
 * Design intent: students on phones, doing this once, often in a hurry. So one
 * card per task, generous spacing, large touch targets (44 px minimum), high
 * contrast, and no decoration that competes with the single action on the screen.
 */

:root {
    --idm-bg: #f4f6f8;
    --idm-surface: #ffffff;
    --idm-border: #dde3e8;
    --idm-text: #1c2429;
    --idm-muted: #5b6770;
    --idm-accent: #0b5fa5;
    --idm-radius: 14px;
}

body {
    background: var(--idm-bg);
    color: var(--idm-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: 1.0625rem;      /* 17px: comfortable on a phone without zooming */
    line-height: 1.6;
}

/* Keyboard users must be able to jump the header; visible only when focused. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--idm-accent);
    color: #fff;
    padding: .75rem 1rem;
    z-index: 100;
}

.skip-link:focus {
    left: 0;
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.idm-header {
    background: var(--idm-surface);
    border-bottom: 1px solid var(--idm-border);
}

.idm-header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1rem;
}

.idm-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.idm-brand img {
    max-height: 40px;
    max-width: 220px;
}

.idm-brand-text {
    font-weight: 600;
    font-size: 1.125rem;
}

.idm-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: .75rem;
}

/* Language switcher: three plain buttons in a form (POST + antiforgery), small
   enough to stay out of the way but still a 44 px touch target. */
.idm-langs {
    display: flex;
    gap: .25rem;
    margin: 0;
}

.idm-lang {
    min-width: 44px;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: none;
    color: var(--idm-muted);
    font-size: .875rem;
    font-weight: 600;
}

.idm-lang:hover,
.idm-lang:focus-visible {
    border-color: var(--idm-border);
    color: var(--idm-text);
}

.idm-lang.is-active {
    background: var(--idm-accent);
    border-color: var(--idm-accent);
    color: #fff;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

.idm-main {
    flex: 1 0 auto;
    padding: 1.5rem 0 3rem;
}

/* One narrow column: the flow is a sequence of single decisions, never a
   dashboard. */
.idm-container {
    max-width: 34rem;
}

.idm-title {
    font-size: 1.625rem;
    font-weight: 700;
    margin-bottom: .5rem;
}

.idm-subtitle {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 1.75rem 0 .5rem;
}

.idm-lead {
    color: var(--idm-muted);
    margin-bottom: 1.5rem;
}

.idm-hint {
    color: var(--idm-muted);
    font-size: .9375rem;
    margin: .75rem 0 0;
}

.idm-label {
    color: var(--idm-muted);
    font-size: .9375rem;
    margin: 1.25rem 0 .25rem;
    text-transform: none;
}

.idm-card {
    background: var(--idm-surface);
    border: 1px solid var(--idm-border);
    border-radius: var(--idm-radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.idm-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .75rem;
}

.idm-card h2 {
    font-size: 1.1875rem;
    font-weight: 700;
    margin-bottom: .5rem;
}

.idm-card-plain {
    text-align: center;
}

.idm-card-plain .btn {
    margin-top: .5rem;
}

.idm-done h1::before {
    content: "✓";
    display: block;
    font-size: 2.5rem;
    color: #1d7a4c;
    line-height: 1;
    margin-bottom: .5rem;
}

.idm-choices {
    display: grid;
    gap: 1rem;
}

.idm-choice p {
    color: var(--idm-muted);
}

/* ── Account and code display ───────────────────────────────────────────── */

/* Monospace so a student reading this aloud or typing it on another device does
   not confuse similar glyphs. */
.idm-account {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.125rem;
    font-weight: 600;
    word-break: break-all;
    margin: 0;
}

.idm-account-masked {
    letter-spacing: .02em;
}

/* The temporary access pass: the single most important thing on its page, and it
   is only shown once. */
.idm-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: clamp(1.375rem, 6vw, 2rem);
    font-weight: 700;
    letter-spacing: .06em;
    word-break: break-all;
    background: #f0f6fc;
    border: 2px dashed var(--idm-accent);
    border-radius: var(--idm-radius);
    padding: 1rem;
    margin: 0 0 1rem;
    text-align: center;
    user-select: all;             /* one tap/triple-click selects the whole code */
}

.idm-nextsteps {
    padding-left: 1.25rem;
}

.idm-nextsteps li {
    margin-bottom: .5rem;
}

/* ── Forms ──────────────────────────────────────────────────────────────── */

.idm-check {
    margin: 1.25rem 0;
    padding-left: 2.25rem;
}

.idm-check .form-check-input {
    width: 1.5rem;
    height: 1.5rem;
    margin-left: -2.25rem;
}

.idm-check .form-check-label {
    padding-left: .25rem;
}

.idm-errors {
    margin: 0;
    padding-left: 1.25rem;
}

.idm-errors li:only-child {
    list-style: none;
    padding-left: 0;
    margin-left: -1.25rem;
}

.btn-lg {
    min-height: 48px;
    font-weight: 600;
}

/* ── Step indicator ─────────────────────────────────────────────────────── */

.idm-steps {
    margin-bottom: 1.25rem;
}

.idm-steps-label {
    color: var(--idm-muted);
    font-size: .875rem;
    margin-bottom: .375rem;
}

.idm-steps-list {
    display: flex;
    gap: .375rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.idm-steps-list li {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--idm-border);
}

.idm-steps-list li.is-done {
    background: #7fb3d9;
}

.idm-steps-list li.is-current {
    background: var(--idm-accent);
}

/* ── Authentication methods list ────────────────────────────────────────── */

.idm-methods {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}

.idm-methods li {
    border-top: 1px solid var(--idm-border);
    padding: .75rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    align-items: baseline;
}

.idm-method-name {
    font-weight: 600;
}

.idm-method-detail,
.idm-method-date {
    color: var(--idm-muted);
    font-size: .9375rem;
}

.idm-method-date {
    margin-left: auto;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

.idm-footer {
    background: var(--idm-surface);
    border-top: 1px solid var(--idm-border);
    color: var(--idm-muted);
    font-size: .9375rem;
    padding: 1.25rem 0;
}

.idm-footer-note {
    margin-bottom: .375rem;
}

/* Respect an explicit request for reduced motion; there is little animation here
   anyway, and none of it carries meaning. */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
