/*
 * Book-a-Team styles. One file, no build step.
 *
 * Colours and sizes are set once in :root. Most rules style plain elements
 * (table, form, button), so a new page looks right without extra classes.
 * The page is served with a Content-Security-Policy that forbids inline
 * styles: everything visual belongs in this file.
 */

:root {
    --bg: #f6f6f3;
    --surface: #ffffff;
    --ink: #1b1c20;
    --muted: #5f636b;
    --line: #e3e3de;
    --line-strong: #cfcfc8;

    /* Green stands for "free" and "go": slots, tags, links, steps. */
    --accent: #0d7a5f;
    --accent-dark: #0a5f4a;
    --accent-soft: #e6f3ee;

    --danger: #c0352b;
    --danger-soft: #fbe9e7;

    --radius: 10px;
    --shadow: 0 1px 2px rgba(27, 28, 32, 0.05), 0 6px 20px rgba(27, 28, 32, 0.05);
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 1.25rem 4rem;
}

/* Text */

h1, h2, h3 {
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 0.75rem;
    overflow-wrap: break-word;
}

/* German has long words. A big heading may split them on a phone. */
:lang(de) h1 {
    hyphens: auto;
}

h1 {
    font-size: 1.9rem;
}

h2 {
    font-size: 1.3rem;
    margin-top: 2.25rem;
}

h3 {
    font-size: 1.05rem;
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--accent-dark);
    text-underline-offset: 0.15em;
}

a:hover {
    color: var(--ink);
}

a:focus-visible, button:focus-visible, summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0.15rem 0.45rem;
    overflow-wrap: anywhere;
}

small, .hint, .field-hint {
    color: var(--muted);
    font-size: 0.875rem;
}

/* Navigation */

nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1.5rem;
    padding: 1.1rem 0;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--line);
}

nav a {
    color: var(--muted);
    font-weight: 500;
    text-decoration: none;
}

nav a:hover {
    color: var(--ink);
}

nav .brand {
    color: var(--ink);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

/* Pushes itself and everything after it to the right */
.nav-end {
    margin-left: auto;
}

.nav-user {
    color: var(--muted);
    font-size: 0.875rem;
}

/* The legal links under every page. The marketing pages list themselves in a
   line of their own above them. */
footer ul {
    display: flex;
    flex-wrap: wrap;
    flex-basis: 100%;
    gap: 0.25rem 1.5rem;
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
}

footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    padding-top: 1.1rem;
    margin-top: 3.5rem;
    border-top: 1px solid var(--line);
    font-size: 0.875rem;
}

footer a {
    color: var(--muted);
    text-decoration: none;
}

footer a:hover {
    color: var(--ink);
}

/* Messages */

.flash {
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
    background: var(--accent-soft);
    border: 1px solid #c9e4d9;
    color: #0b4f3e;
}

.flash.error {
    background: var(--danger-soft);
    border-color: #f1c9c5;
    color: #7d1f17;
}

/* Long texts: imprint, privacy policy, terms, the marketing pages. Lines stay
   short enough to read. */
article {
    max-width: 46rem;
}

/* A marketing page opens with a heading and a lead outside an article. They
   stay as narrow as one. Headings of other pages keep the full width. */
main > h1:has(+ .lead), main > .lead {
    max-width: 46rem;
}

article h3 {
    margin-top: 1.75rem;
}

article h4 {
    margin: 1.25rem 0 0.5rem;
}

/* Lists of a contract whose items carry their own "(a)", "(b)" */
ol.clauses, ol.clauses ol {
    list-style: none;
    padding-left: 0;
}

ol.clauses ol {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

ol.clauses li {
    margin-bottom: 0.5rem;
}

/* Tables */

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

th, td {
    text-align: left;
    vertical-align: middle;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--line);
}

tbody tr:last-child th, tbody tr:last-child td {
    border-bottom: none;
}

th {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    background: #fbfbf9;
}

/* Forms */

form {
    max-width: 34rem;
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    margin-bottom: 1rem;
    font: inherit;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="checkbox"] {
    accent-color: var(--accent);
}

/* A label with a checkbox in front of its text */
label.checkbox {
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 0.4rem;
}

fieldset {
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem 0.75rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

legend {
    padding: 0 0.4rem;
    font-weight: 600;
}

.field-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: -0.75rem;
    margin-bottom: 0.75rem;
}

/* Sits tight under the input it explains */
.field-hint {
    margin-top: -0.75rem;
    margin-bottom: 0.75rem;
}

.hint {
    margin-top: 0.75rem;
}

/* A form that sits in a line of text or in a table cell */
.inline-form {
    display: inline;
    margin-left: 0.6rem;
}

/* The "from - to" filter above the slots */
.date-range {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.75rem;
    max-width: none;
    margin-bottom: 1.5rem;
}

.date-range input {
    width: auto;
    margin-bottom: 0;
}

.rule-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.rule-row input {
    margin-bottom: 0;
}

.rule-row .rule-count {
    width: 6rem;
    flex: none;
}

/* Buttons. Links that should look like buttons get the class "btn". */

button, .btn {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    background: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}

button:hover, .btn:hover {
    color: #fff;
    background: #33353c;
    border-color: #33353c;
}

/* Two buttons in a row keep a little distance */
button + .btn, .btn + .btn, .btn + button, button + button {
    margin-left: 0.4rem;
}

.btn-secondary {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line-strong);
}

.btn-secondary:hover {
    color: var(--ink);
    background: #efefea;
    border-color: var(--line-strong);
}

.btn-danger {
    color: var(--danger);
    background: var(--surface);
    border-color: #e6b5b0;
}

.btn-danger:hover {
    color: #fff;
    background: var(--danger);
    border-color: var(--danger);
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-accent:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.btn-small {
    padding: 0.25rem 0.7rem;
    font-size: 0.85rem;
}

.btn-large {
    padding: 0.8rem 1.5rem;
    font-size: 1.05rem;
}

/* Buttons and links next to each other, wrapping on small screens */
.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.actions > *, .actions > .btn {
    margin: 0;
}

/* Small labels: skills of an employee */
.tag {
    display: inline-block;
    padding: 0.05rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #0b4f3e;
    background: var(--accent-soft);
    border-radius: 999px;
    white-space: nowrap;
}

/* Slots a candidate can book */

.slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.slot-form {
    margin: 0;
}

.slot-btn {
    width: 100%;
    padding: 0.75rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
}

.slot-btn:hover, .slot-btn:focus-visible {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

/* Landing page */

.hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 2.5rem;
    align-items: center;
    padding: 3rem;
    margin-bottom: 3.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 2.9rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.15rem;
    color: var(--muted);
    margin-bottom: 1.75rem;
}

/* A picture of the product made of plain HTML */
.example {
    padding: 1.25rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.example h3 {
    margin-bottom: 0.4rem;
}

.example .slot-grid {
    grid-template-columns: repeat(2, 1fr);
    margin: 1rem 0 0;
}

.example .slot {
    padding: 0.55rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
}

.example .slot.picked {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr));
    gap: 1rem;
    margin-bottom: 3.5rem;
}

.card {
    padding: 1.4rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.card p {
    margin: 0;
    color: var(--muted);
}

/* Numbered steps. The numbers come from the list itself. */
ol.steps {
    list-style: none;
    padding: 0;
    counter-reset: step;
}

ol.steps li {
    counter-increment: step;
}

ol.steps li::before {
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-bottom: 0.8rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    border-radius: 50%;
}

.closing {
    padding: 2.5rem 1.5rem;
    margin-top: 3.5rem;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.closing .actions {
    justify-content: center;
}

@media (max-width: 640px) {
    .hero {
        padding: 1.75rem 1.25rem;
    }

    /* A table that is wider than the phone scrolls sideways on its own */
    table {
        display: block;
        overflow-x: auto;
    }

    th, td {
        padding: 0.6rem 0.75rem;
        white-space: nowrap;
    }
}
