/* =====================================================================
   barox SN Check – Stylesheet
   Corporate Design laut "Corporate Design Manual | barox Kommunikation":
     Nachtblau  #002D4E  (Primaerfarbe)
     Bernstein  #F7A600  (Akzent)
     Schrift    Helvetica Now (Display fuer Headlines, Text fuer Fliesstext)
   ===================================================================== */

/* ---- Schriften ------------------------------------------------------ */
@font-face {
    font-family: "Helvetica Now Display";
    src: url("/assets/fonts/HelveticaNowDisplay-Bd.otf") format("opentype");
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Helvetica Now Display";
    src: url("/assets/fonts/HelveticaNowDisplay-Md.otf") format("opentype");
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Helvetica Now Display";
    src: url("/assets/fonts/HelveticaNowDisplay-Regular.otf") format("opentype");
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Helvetica Now Text";
    src: url("/assets/fonts/HelveticaNowText-Regular.otf") format("opentype");
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Helvetica Now Text";
    src: url("/assets/fonts/HelveticaNowText-Medium.otf") format("opentype");
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Helvetica Now Text";
    src: url("/assets/fonts/HelveticaNowText-Bold.otf") format("opentype");
    font-weight: 700; font-style: normal; font-display: swap;
}

/* ---- Design-Tokens -------------------------------------------------- */
:root {
    --nachtblau: #002D4E;
    --nachtblau-80: #33576f;
    --nachtblau-60: #6681a2;   /* aufgehellte Abstufungen laut Sekundaerfarben */
    --nachtblau-10: #e6ebef;
    --nachtblau-05: #f2f5f7;
    --bernstein: #F7A600;
    --bernstein-dark: #d68f00;

    --green: #2e9e5b;
    --green-bg: #e7f5ec;
    --red: #d0392b;
    --red-bg: #fbecea;
    --grey: #6b7a86;
    --grey-bg: #eef1f3;

    --ink: #101820;
    --muted: #5b6b78;
    --line: #dde3e8;
    --white: #ffffff;

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 10px 30px rgba(0, 45, 78, 0.10);
    --shadow-lg: 0 20px 60px rgba(0, 45, 78, 0.18);

    --font-display: "Helvetica Now Display", "Helvetica Neue", Arial, sans-serif;
    --font-text: "Helvetica Now Text", "Helvetica Neue", Arial, sans-serif;
}

/* ---- Grundlayout ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: var(--font-text);
    color: var(--ink);
    background: var(--nachtblau-05);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}
a { color: var(--nachtblau); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0; color: var(--nachtblau); }

.container { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* ---- Topbar --------------------------------------------------------- */
.topbar {
    background: var(--nachtblau);
    color: var(--white);
}
.topbar__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 14px 20px; max-width: 1120px; margin: 0 auto;
}
.topbar__logo { height: 30px; width: auto; display: block; }
.topbar__right { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.topbar__user { color: #cdd8e0; white-space: nowrap; max-width: 45vw; overflow: hidden; text-overflow: ellipsis; }
.btn-logout {
    color: var(--white); text-decoration: none; border: 1px solid rgba(255,255,255,.35);
    padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; transition: background .15s;
}
.btn-logout:hover { background: rgba(255,255,255,.12); }

/* ---- Hauptbereich --------------------------------------------------- */
.main { padding: 44px 0 80px; }
.page-head { text-align: center; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.01em; }
.page-head p { color: var(--muted); margin: 10px 0 0; font-size: 16px; }

/* ---- Suchfeld ------------------------------------------------------- */
.search-card {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 26px; border: 1px solid var(--line);
}
.search-form { display: flex; gap: 12px; align-items: stretch; }
.search-input-wrap { position: relative; flex: 1; }
.search-input {
    width: 100%; font-family: var(--font-text); font-size: 20px; font-weight: 500;
    padding: 18px 18px; border: 2px solid var(--line); border-radius: var(--radius-sm);
    color: var(--ink); background: var(--white); transition: border-color .15s, box-shadow .15s;
    letter-spacing: 0.02em;
}
.search-input::placeholder { color: #9aa8b2; font-weight: 400; letter-spacing: normal; }
.search-input:focus {
    outline: none; border-color: var(--nachtblau);
    box-shadow: 0 0 0 4px rgba(0, 45, 78, 0.10);
}
.btn-primary {
    font-family: var(--font-display); font-weight: 700; font-size: 17px; cursor: pointer;
    background: var(--bernstein); color: var(--nachtblau); border: none;
    padding: 0 30px; border-radius: var(--radius-sm); transition: background .15s, transform .05s;
    display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
}
.btn-primary:hover { background: var(--bernstein-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.search-hint { margin: 12px 2px 0; font-size: 13px; color: var(--muted); }

/* Spinner */
.spinner {
    width: 18px; height: 18px; border-radius: 50%;
    border: 2px solid rgba(0,45,78,.35); border-top-color: var(--nachtblau);
    animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Ergebnisbereich ------------------------------------------------ */
.results { margin-top: 26px; display: grid; gap: 18px; }

.message {
    display: flex; gap: 12px; align-items: flex-start;
    background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--grey);
    border-radius: var(--radius-sm); padding: 16px 18px; box-shadow: var(--shadow);
}
.message--empty { border-left-color: var(--bernstein); }
.message--error { border-left-color: var(--red); background: var(--red-bg); }
.message--warning { border-left-color: var(--bernstein); background: #fff8e9; }
.message strong { display: block; font-family: var(--font-display); color: var(--nachtblau); }
.message p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* Statuskarte */
.result-card {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.result-card__status {
    display: flex; align-items: center; gap: 12px; padding: 16px 22px;
    font-family: var(--font-display); font-weight: 700; font-size: 18px;
}
.result-card__status .dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
.result-card__meta { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.result-card__meta .days { font-family: var(--font-text); font-weight: 500; font-size: 14px; opacity: .9; }
.mandant-tag {
    font-family: var(--font-text); font-weight: 700; font-size: 12px; letter-spacing: .02em;
    background: var(--nachtblau); color: var(--white); padding: 4px 10px; border-radius: 999px;
    white-space: nowrap;
}

.status--in_warranty  { background: var(--green-bg); color: #1c6b3d; }
.status--in_warranty .dot { background: var(--green); }
.status--expired      { background: var(--red-bg); color: #a12c20; }
.status--expired .dot { background: var(--red); }
.status--undetermined { background: var(--grey-bg); color: #4c5a65; }
.status--undetermined .dot { background: var(--grey); }

.result-card__body { padding: 20px 22px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px 28px; }
.field { min-width: 0; }
.field__label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; }
.field__value { font-size: 16px; font-weight: 500; color: var(--ink); margin-top: 3px; word-break: break-word; }
.field__value.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.field__value--muted { color: #9aa8b2; font-weight: 400; }

.result-count { font-size: 14px; color: var(--muted); margin: 2px 0 -4px; }

/* ---- Letzte Suchen -------------------------------------------------- */
.recent { margin-top: 40px; }
.recent h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-family: var(--font-text); font-weight: 500; }
.recent__list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.recent__item {
    background: var(--white); border: 1px solid var(--line); border-radius: 999px;
    padding: 7px 14px; font-size: 13px; cursor: pointer; color: var(--nachtblau);
    font-weight: 500; transition: border-color .15s, background .15s;
}
.recent__item:hover { border-color: var(--nachtblau-60); background: var(--nachtblau-05); }
.recent__item .badge { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ---- Login ---------------------------------------------------------- */
.login-shell {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background: radial-gradient(1200px 600px at 50% -10%, #063b63 0%, var(--nachtblau) 55%);
}
.login-card {
    width: 100%; max-width: 420px; background: var(--white);
    border-radius: 18px; box-shadow: var(--shadow-lg); padding: 40px 36px; text-align: center;
}
.login-card__logo { width: 190px; max-width: 70%; height: auto; margin: 0 auto 26px; display: block; }
.login-card h1 { font-size: 22px; }
.login-card p { color: var(--muted); margin: 10px 0 26px; font-size: 15px; }
.btn-ms {
    display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%;
    background: var(--nachtblau); color: var(--white); text-decoration: none;
    font-family: var(--font-display); font-weight: 700; font-size: 16px;
    padding: 15px 20px; border-radius: var(--radius-sm); transition: background .15s;
}
.btn-ms:hover { background: #063b63; }
.ms-logo { width: 20px; height: 20px; flex: 0 0 auto; }
.login-error {
    background: var(--red-bg); color: #a12c20; border: 1px solid #f2c4bf;
    border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; margin-bottom: 20px; text-align: left;
}
.login-foot { margin-top: 24px; font-size: 12px; color: #9aa8b2; }

/* ---- Fehlerseite ---------------------------------------------------- */
.error-shell { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 40px 20px; }
.error-code { font-family: var(--font-display); font-size: 72px; color: var(--nachtblau); line-height: 1; }
.error-shell p { color: var(--muted); margin: 12px 0 24px; font-size: 16px; }

/* ---- Footer --------------------------------------------------------- */
.foot { text-align: center; color: #9aa8b2; font-size: 12px; padding: 30px 0 40px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Responsive ----------------------------------------------------- */
@media (max-width: 620px) {
    .search-form { flex-direction: column; }
    .btn-primary { padding: 15px 20px; justify-content: center; }
    .field-grid { grid-template-columns: 1fr; }
    .topbar__user { max-width: 38vw; }
    .main { padding: 28px 0 60px; }
}
