/* TEMSAFE frontend styles - values from docs/design/ui-style-guide.md */

:root {
    --navy: #16298a;
    --ink: #1d2433;
    --muted: #5d6475;
    --line: #dcdcec;
    --bg: #f5f5fa;
    --green: #1e6b34;
    --green-bg: #e5f3e8;
    --amber: #7a5600;
    --amber-bg: #fff3d1;
    --red: #a3222b;
    --red-bg: #fbe4e6;
    --grey: #4c5363;
    --grey-bg: #eceef3;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    font-size: 16px;
    color: var(--ink);
    background: var(--bg);
}

main {
    max-width: 420px;
    margin: 0 auto;
    padding: 24px 20px;
}

main.wide {
    max-width: 1100px;
}

:focus-visible {
    outline: 3px solid var(--navy);
    outline-offset: 2px;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
}

.brand {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    color: var(--navy);
}

.muted {
    color: var(--muted);
    font-size: 14px;
}

.card {
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}

input {
    width: 100%;
    font: inherit;
    padding: 12px 14px;
    border: 2px solid #b8bccb;
    border-radius: 12px;
    margin-bottom: 14px;
}

.btn {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 13px;
    border: 2px solid var(--navy);
    border-radius: 16px;
    background: var(--navy);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.api-status {
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 99px;
    display: inline-block;
}

.api-status.ok {
    background: var(--green-bg);
    color: var(--green);
}

.api-status.down {
    background: var(--grey-bg);
    color: var(--grey);
}

.banner {
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 12px;
    background: #e8ecfb;
    color: #1f2f7a;
    border: 1.5px solid #b9c3ef;
}

/* Navigation */
.site-header {
    background: #fff;
    border-bottom: 1.5px solid var(--line);
}

.nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    align-items: center;
}

.nav .brand {
    font-size: 20px;
    margin-right: auto;
}

.nav a {
    color: var(--navy);
    font-weight: 600;
    padding: 10px 4px;
}

.nav a[aria-current="page"] {
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 3px;
}

.page-title {
    margin: 0;
    font-size: 24px;
}

/* Status card */
.status {
    border: 2.5px solid;
    border-radius: 22px;
    padding: 16px 18px;
    margin-bottom: 12px;
}

.status-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.status-icon {
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
}

.status-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
}

.status-text {
    margin: 4px 0 0;
    font-size: 14px;
}

.value {
    margin-top: 10px;
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
}

.value small {
    font-size: 28px;
}

.meta {
    margin-top: 8px;
    font-size: 13px;
    color: var(--ink);
}

.normal {
    background: var(--green-bg);
    border-color: var(--green);
    color: var(--green);
}

.normal .status-icon {
    background: var(--green);
}

.warning {
    background: var(--amber-bg);
    border-color: #c89211;
    color: var(--amber);
}

.warning .status-icon {
    background: #c89211;
}

.alert {
    background: var(--red-bg);
    border-color: var(--red);
    color: var(--red);
}

.alert .status-icon {
    background: var(--red);
}

.unknown {
    background: var(--grey-bg);
    border-color: #8a90a0;
    color: var(--grey);
}

.unknown .status-icon {
    background: var(--grey);
}

/* Details and empty state */
.kv {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    margin: 0;
    font-size: 14px;
}

.kv dt {
    color: var(--muted);
    font-weight: 600;
}

.kv dd {
    margin: 0;
}

.empty {
    text-align: center;
    padding: 24px 0;
}

.empty-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--grey-bg);
    color: var(--grey);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 800;
}

#sample-states a[aria-current="page"] {
    font-weight: 700;
}

/* Wider screens: details next to the status card */
@media (min-width: 900px) {
    main:not(.wide) {
        max-width: 760px;
    }
}
