/* DoorsDesk portal styles. Colours come from the logo (graphite, copper, grey); the copper used for text and buttons is the darker
   one (#8a5f2e): the logo copper (#a77a46) has only 3.8:1 contrast on white, the darker one 5.6:1. */

@font-face {
    font-family: "Manrope";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("fonts/manrope-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: "Manrope";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("fonts/manrope-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --ink: #2a2e34;
    --ink-2: #3e424a;
    --muted: #5b6068;
    --copper: #a77a46;
    --copper-dark: #8a5f2e;
    --copper-darker: #704b22;
    --page: #f5f3ef;
    --card: #ffffff;
    --line: #dedad2;
    --error: #a12622;
    --error-bg: #fbeceb;
    --ok: #1f6b3a;
    --ok-bg: #e9f5ee;
    --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--page);
}

/* ---------- header ---------- */
.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--line);
}
.site-header__inner {
    max-width: 1040px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.brand { display: inline-flex; line-height: 0; }
.brand img { height: 38px; width: auto; }
.site-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; }
.site-nav a {
    color: var(--ink-2);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 6px 2px;
}
.site-nav a:hover { color: var(--copper-dark); }
.site-nav a[aria-current="true"] { color: var(--copper-dark); border-bottom: 2px solid var(--copper); }
.site-nav__lang { display: flex; gap: 12px; }
.site-nav__user { display: flex; align-items: center; gap: 16px; }

/* ---------- page ---------- */
main { max-width: 1040px; margin: 0 auto; padding: 28px 16px 56px; }

h1 { font-size: 28px; line-height: 1.2; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 20px; line-height: 1.3; font-weight: 700; margin: 0 0 12px; }
p { margin: 0 0 12px; }
a { color: var(--copper-dark); text-underline-offset: 2px; }
a:hover { color: var(--copper-darker); }

section, .card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin: 0 0 20px;
}

/* the one header of every registration page (factory and distributor look the same) */
.reg-header {
    border-left: 4px solid var(--copper);
    padding: 4px 0 4px 16px;
    margin: 0 0 24px;
}
.reg-header h1 { margin-bottom: 4px; }
.reg-header p { color: var(--muted); margin: 0; max-width: 60ch; }

/* ---------- sign-in card ---------- */
.auth-card {
    max-width: 420px;
    margin: 24px auto 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px 24px;
}
.auth-card__logo { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto 20px; }
.auth-card h1 { text-align: center; font-size: 22px; }
/* ---------- forms ---------- */
form > div, form > div > div { margin: 0 0 16px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 4px; }
input:not([type]), input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="password"], input[type="search"],
select, textarea {
    width: 100%;
    max-width: 520px;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid #b9b4aa;
    border-radius: 6px;
    padding: 10px 12px;
    min-height: 44px;
}
input[type="file"] { font: inherit; max-width: 100%; }
textarea { min-height: 72px; resize: vertical; }
:focus-visible { outline: 3px solid var(--copper-dark); outline-offset: 2px; }

/* checkbox / radio lists (brands) */
#registration_brands { display: flex; flex-wrap: wrap; gap: 8px 16px; }
#registration_brands > input { margin: 0 6px 0 0; }
input[type="checkbox"] + label, input[type="radio"] + label { display: inline; font-weight: 500; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--copper-dark); vertical-align: -3px; }
/* the agreement checkbox: box and text on one line */
form > div:has(> input[type="checkbox"]) { display: flex; gap: 8px; align-items: flex-start; }
form > div:has(> input[type="checkbox"]) > input { order: -1; margin-top: 3px; flex: none; }
form > div:has(> input[type="checkbox"]) > label { font-weight: 500; margin: 0; }

.help-text, form p[id$="_help"] { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
form ul { list-style: none; margin: 4px 0 0; padding: 0; color: var(--error); font-weight: 600; font-size: 14px; }

button, .button {
    display: inline-block;
    font: inherit;
    font-weight: 700;
    color: #fff;
    background: var(--copper-dark);
    border: 1px solid var(--copper-dark);
    border-radius: 6px;
    padding: 10px 20px;
    min-height: 44px;
    cursor: pointer;
    text-decoration: none;
}
button:hover, .button:hover { background: var(--copper-darker); border-color: var(--copper-darker); color: #fff; }
.button-secondary { color: var(--ink); background: #fff; border-color: #b9b4aa; }
.button-secondary:hover { color: var(--ink); background: var(--page); border-color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 16px 0 0; }
.actions form { margin: 0; }

/* ---------- messages ---------- */
.flash { padding: 12px 16px; border-radius: 8px; border-left: 4px solid; margin: 0 0 16px; font-weight: 600; }
.flash-error { color: var(--error); background: var(--error-bg); border-color: var(--error); }
.flash-success { color: var(--ok); background: var(--ok-bg); border-color: var(--ok); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: #faf8f4; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { border-bottom: 1px solid #eeebe4; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfaf6; }
td select { max-width: 280px; }

/* numbers of the check report */
.stats { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 12px; }
.stats li { background: #faf8f4; border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; }
.stats strong { display: block; font-size: 24px; line-height: 1.2; }

.search-form { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 0 0 16px; }
.search-form label { margin: 0; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin: 0 0 16px; font-weight: 600; }

@media (max-width: 640px) {
    h1 { font-size: 24px; }
    main { padding-top: 20px; }
    section, .card { padding: 16px; }
    .site-header__inner { flex-wrap: wrap; }
}

/* ---------- registration: choose the brands by typing (assets/registration.js) ---------- */
[hidden] { display: none !important; }
.brand-picker { max-width: 520px; }
.brand-chips { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 4px 2px 12px; border: 1px solid var(--copper); border-radius: 999px;
    background: #fbf6ef; font-weight: 600; font-size: 14px;
}
.chip button {
    min-height: 28px; width: 28px; padding: 0; border: 0; border-radius: 50%;
    background: transparent; color: var(--copper-dark); font-size: 18px; line-height: 1;
}
.chip button:hover { background: var(--copper-dark); color: #fff; }
.brand-notice { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid var(--copper); background: #faf8f4; color: var(--ink-2); font-size: 14px; }
.link-button {
    min-height: 0; margin-top: 6px; padding: 4px 0; border: 0; background: none;
    color: var(--copper-dark); font-weight: 600; text-decoration: underline; cursor: pointer;
}
.link-button:hover { background: none; color: var(--copper-darker); }
