/* Look of the SSA service portal and the demonstrator start page. The page has its own form
   and table styles, so the tokens are repeated here instead of sharing ../main.css.
   Theme and language are remembered like on the portal. */

* {
    box-sizing: border-box;
}
:root {
    color-scheme: dark;
    --bg: #24282d;
    --card: #2e343b;
    --field: #24282d;
    --border: #3d444d;
    --border-strong: #4b5361;
    --text: #eee;
    --text-soft: #cfd8e0;
    --muted: #8fa3b5;
    --accent: #6fb0e8;
    --ok: #8fd694;
    --warn: #e7b063;
    --danger: #a32d2d;
    --danger-text: #f09595;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #eef1f4;
    --card: #ffffff;
    --field: #f7f9fb;
    --border: #d5dbe2;
    --border-strong: #b7c0ca;
    --text: #1f262d;
    --text-soft: #3a4650;
    --muted: #5f6f7d;
    --accent: #1958b7;
    --ok: #2e7d32;
    --warn: #9a5b00;
    --danger-text: #a32d2d;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Lucida, Geneva, Helvetica, Arial, sans-serif;
}
#page {
    max-width: 56em;
    margin: 0 auto;
    padding: 2em 1em 3em;
}
svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
a {
    color: var(--accent);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* head: title, language and theme */
.topline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5em 1em;
}
h1 {
    font-size: clamp(1.7em, 8vw, 2.2em);
    margin: 0;
}
.subtitle {
    color: var(--muted);
    margin: 0 0 1.5em 0;
}
.switches {
    display: flex;
    gap: 0.5em;
}
#lang_toggle,
#theme_toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 2.6em;
    margin-top: 0.3em;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--muted);
    font-family: inherit;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
#lang_toggle {
    gap: 0.35em;
    padding: 0 0.9em;
    border-radius: 1.3em;
    font-size: 0.85em;
    font-weight: bold;
}
#lang_toggle span {
    opacity: 0.45;
}
:root[data-lang="de"] #lang_toggle [data-lang="de"],
:root[data-lang="en"] #lang_toggle [data-lang="en"] {
    opacity: 1;
    color: var(--text);
}
#theme_toggle {
    width: 2.6em;
    border-radius: 50%;
}
#lang_toggle:hover,
#theme_toggle:hover {
    color: var(--text);
    border-color: var(--muted);
}
#theme_toggle svg {
    width: 1.3em;
    height: 1.3em;
}
#theme_toggle .sun { display: none; }
:root[data-theme="light"] #theme_toggle .sun { display: block; }
:root[data-theme="light"] #theme_toggle .moon { display: none; }

/* sections and cards */
section {
    margin-top: 1.8em;
}
h2 {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 0.9em;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 0.5em 0;
}
h2 svg {
    width: 1.2em;
    height: 1.2em;
}
h2 .step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6em;
    height: 1.6em;
    border-radius: 50%;
    background: #2175bc;
    color: #fff;
    font-size: 0.85em;
    letter-spacing: 0;
}
h3 {
    font-size: 1em;
    margin: 0 0 0.6em;
}
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1em 1.2em;
    box-shadow: var(--shadow);
}
.intro {
    line-height: 1.5;
}
.intro p {
    margin: 0 0 0.6em;
}
.links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em 1.5em;
    font-size: 0.92em;
}
.links a {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    text-decoration: none;
    font-weight: bold;
}
.links a:hover {
    text-decoration: underline;
}
.links svg {
    width: 1.1em;
    height: 1.1em;
}
p.hint {
    margin: 0.4em 0 0;
    color: var(--muted);
    font-size: 0.85em;
}

/* form fields */
.fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10em, 1fr));
    gap: 0.8em 1em;
}
label,
.field {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
    color: var(--muted);
    font-size: 0.85em;
}
label.wide {
    grid-column: span 2;
}
input,
select {
    width: 100%;
    padding: 0.6em 0.7em;
    background: var(--field);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
}
input:disabled,
select:disabled {
    opacity: 0.5;
}
.inline {
    display: flex;
    gap: 0.5em;
    align-items: stretch;
}
.inline input {
    flex: 1;
    min-width: 0;
}

/* environment switch: test cloud or production */
.segmented {
    display: inline-flex;
    padding: 3px;
    background: var(--field);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
}
.segmented button {
    padding: 0.45em 0.9em;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-soft);
    font-family: inherit;
    font-size: 0.95em;
    cursor: pointer;
}
.segmented button.active {
    background: #2175bc;
    color: #fff;
    font-weight: bold;
}
.segmented button.active.prod {
    background: var(--danger);
}
.prod-warning {
    display: none;
    margin: 0.6em 0 0;
    color: var(--danger-text);
    font-size: 0.85em;
    font-weight: bold;
}
:root[data-env="prod"] .prod-warning {
    display: block;
}

/* buttons */
button.primary,
button.secondary,
button.danger,
button.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45em;
    padding: 0.65em 1.1em;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
button.primary {
    background: #2175bc;
    border: 1px solid #2175bc;
    color: #fff;
}
button.primary:hover {
    background: #2b86d4;
}
button.secondary,
button.icon {
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-soft);
}
button.secondary:hover,
button.icon:hover {
    border-color: var(--muted);
    color: var(--text);
}
button.icon {
    padding: 0.5em 0.7em;
}
button.danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger-text);
}
button.danger:hover {
    background: var(--danger);
    color: #fff;
}
button svg {
    width: 1.15em;
    height: 1.15em;
}
button:disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}
.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6em;
    margin-top: 1em;
}

/* status line under each block */
.status {
    min-height: 1.3em;
    margin: 0.7em 0 0;
    color: var(--muted);
    font-size: 0.9em;
}
.status:empty {
    display: none;
}
.status.ok { color: var(--ok); }
.status.err { color: var(--danger-text); }
.status.busy { color: var(--warn); }

/* the two booking ways side by side on wide screens */
.ways {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1em;
    margin-top: 1.2em;
    padding-top: 1.2em;
    border-top: 1px solid var(--border);
}
.ways .actions {
    margin-top: 0.8em;
}

/* disabled until signed in */
.locked {
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}

/* credit list */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6em;
    margin-bottom: 0.8em;
}
.toolbar select {
    width: auto;
}
.toolbar .spacer {
    flex: 1;
}
.toolbar .count {
    color: var(--muted);
    font-size: 0.9em;
}
.table-wrap {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92em;
}
th {
    padding: 0.5em 0.6em;
    border-bottom: 1px solid var(--border-strong);
    color: var(--muted);
    font-size: 0.8em;
    font-weight: normal;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
td {
    padding: 0.5em 0.6em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
tr:last-child td {
    border-bottom: none;
}
th.num,
td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
td.mono {
    font-family: Consolas, 'Courier New', monospace;
}
td.empty {
    color: var(--muted);
    text-align: center;
    padding: 1.5em;
    white-space: normal;
}
.chip {
    display: inline-block;
    padding: 0.1em 0.55em;
    border-radius: 1em;
    font-size: 0.85em;
    font-weight: bold;
    border: 1px solid currentColor;
}
.chip.s0 { color: var(--ok); }
.chip.s1 { color: var(--warn); }
.chip.s2 { color: var(--muted); }
.chip.sx { color: var(--danger-text); }
td button.icon {
    padding: 0.25em 0.45em;
}

@media (min-width: 48em) {
    .ways {
        grid-template-columns: 1fr 1fr;
        column-gap: 2em;
    }
}
@media (max-width: 30em) {
    label.wide {
        grid-column: auto;
    }
}
