/* pinwally base stylesheet — no framework, CSS custom properties as tokens */

/* Self-hosted fonts, no CDN request ever. Variable where available. */
@font-face {
    font-family: 'Nunito';
    src: url('/assets/fonts/nunito.woff2') format('woff2');
    font-weight: 400 700;
    font-display: swap;
}
@font-face {
    font-family: 'Merriweather';
    src: url('/assets/fonts/merriweather.woff2') format('woff2');
    font-weight: 400 700;
    font-display: swap;
}
@font-face {
    font-family: 'Patrick Hand';
    src: url('/assets/fonts/patrick-hand.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

:root {
    --color-bg: #f7f6f2;
    --color-surface: #ffffff;
    --color-text: #23281f;
    --color-text-muted: #61685c;
    --color-primary: #2f6f68;
    --color-primary-dark: #245a54;
    --color-accent: #e2a33c;
    --color-accent-soft: #fbeed6;
    --color-border: #e4e2d9;
    --color-subbar: #edf3f2;
    --color-danger: #b8453a;
    --color-frozen: #3f6ea8; /* = the blue pen colour */
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 2px 10px rgba(35, 40, 31, 0.07);
    --shadow-lift: 0 8px 26px rgba(35, 40, 31, 0.14);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Nunito', var(--font);
}

* { box-sizing: border-box; }

/* The browser's own [hidden] rule loses against any author `display`, so an
   element the scripts hide — the join dialog, an empty author chip — would
   stay on screen. This puts the attribute back in charge everywhere. */
[hidden] { display: none !important; }

/* Label that only screen readers need, e.g. on an icon-only button. */
/* Honeypot on the registration form: out of sight, not display:none —
   some bots skip fields they can tell are hidden. */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding-inline: 20px;
}
main.container { flex: 1; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.015em; }

/* --- Header / footer ------------------------------------------------ */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 62px;
    gap: 16px;
}
.logo {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-text);
}
.logo__icon { width: 26px; height: 26px; display: block; margin-right: 9px; }
.logo span { color: var(--color-primary); }
.logo:hover { text-decoration: none; }
.site-nav { display: flex; align-items: center; gap: 18px; }
/* Plain links only: a .btn in the navigation brings its own colour, and
   `.site-nav a` (0,1,1) would beat `.btn--primary` (0,1,0) on specificity —
   which is how «Konto erstellen» ended up with black text on dark green. */
.site-nav a:not(.btn) { color: var(--color-text); }

.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    margin-top: 56px;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
    justify-content: space-between;
    padding-block: 18px;
}
.site-footer__links, .lang-switch { display: flex; gap: 16px; }
.lang-switch__current { font-weight: 600; color: var(--color-text); }

/* --- Buttons --------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    background: none;
}
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-dark); text-decoration: none; }
.btn--secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn--secondary:hover { border-color: var(--color-primary); text-decoration: none; }
.btn--danger { background: none; color: var(--color-danger); border-color: var(--color-border); }
.btn--small { padding: 7px 14px; font-size: 0.9rem; }
.btn[hidden] { display: none; }
.btn--block { display: block; width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-link {
    background: none; border: none; padding: 0;
    color: var(--color-primary); cursor: pointer; font: inherit;
}

/* --- Flash & forms ---------------------------------------------------- */
.flash {
    margin: 18px 0 0;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}
.flash--success { border-color: #bfdcc9; background: #eef7f1; }
.flash--error { border-color: #e9c6c2; background: #fbeeec; }
.form-error { color: var(--color-danger); margin: 0 0 12px; }
.field-error { color: var(--color-danger); font-size: 0.88rem; margin: -8px 0 10px; }

label { display: block; font-weight: 600; font-size: 0.92rem; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font: inherit;
    background: var(--color-surface);
    color: var(--color-text);
}
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* --- Landing page ------------------------------------------------------ */
.hero { text-align: center; padding: 64px 0 36px; }
.hero h1 {
    font-size: clamp(1.9rem, 4.6vw, 3rem);
    line-height: 1.15;
    margin: 0 0 16px;
}
.hero__subtitle {
    max-width: 640px;
    margin: 0 auto 30px;
    color: var(--color-text-muted);
    font-size: 1.12rem;
}
.join-form { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.join-form input {
    width: 190px;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.hero__alt { margin-top: 14px; font-size: 0.95rem; color: var(--color-text-muted); }

.hero-banner-wrap { display: flex; justify-content: center; margin: 8px 0 44px; }
.hero-banner {
    margin: 0;
    padding: 9px 20px;
    border-radius: 999px;
    background: var(--color-accent-soft);
    border: 1px solid #f0ddb8;
    font-size: 0.92rem;
    font-weight: 600;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 56px;
}
.feature-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.feature-card h2 { margin: 0 0 8px; font-size: 1.16rem; }
.feature-card p { margin: 0; color: var(--color-text-muted); }
.feature-card::before {
    content: '';
    display: block;
    width: 34px; height: 34px;
    margin-bottom: 14px;
    border-radius: 9px;
    background: var(--color-accent-soft);
    border: 1px solid #f0ddb8;
}
.feature-card--beamer::before { background: #e3efed; border-color: #cbe0dc; }
.feature-card--control::before { background: #f2e8f3; border-color: #e2d0e4; }

/* Numbered "how it works" strip */
.steps {
    display: grid;
    /* At most three columns: the title spans every track, so auto-fit would
       otherwise keep empty ones on a wide screen and push the steps left. */
    grid-template-columns: repeat(auto-fit, minmax(max(240px, (100% - 2 * 22px) / 3), 1fr));
    gap: 22px;
    margin-bottom: 56px;
    counter-reset: step;
}
.steps__title { text-align: center; font-size: 1.5rem; margin: 0 0 24px; grid-column: 1 / -1; }
.step { counter-increment: step; padding-left: 52px; position: relative; }
.step::before {
    content: counter(step);
    position: absolute; left: 0; top: 0;
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 800;
}
.step h3 { margin: 4px 0 6px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--color-text-muted); font-size: 0.96rem; }

.trust {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 32px 28px;
    margin-bottom: 48px;
}
.trust__title { text-align: center; margin: 0 0 24px; font-size: 1.5rem; }
.trust__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px;
}
.trust__item h3 { margin: 0 0 6px; font-size: 1.02rem; }
.trust__item p { margin: 0; color: var(--color-text-muted); font-size: 0.95rem; }
.trust__more { text-align: center; margin: 24px 0 0; }

.home-cta { text-align: center; padding: 8px 0 56px; }
.home-cta h2 { font-size: 1.6rem; margin: 0 0 10px; }
.home-cta p { color: var(--color-text-muted); margin: 0 0 22px; }
.home-cta__buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* --- Auth cards --------------------------------------------------------- */
.auth-card {
    max-width: 420px;
    margin: 48px auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 6px; font-size: 1.5rem; }
.auth-card__intro { color: var(--color-text-muted); margin: 0 0 8px; }
.auth-card .btn--block { margin-top: 20px; }
.auth-card__alt { margin: 18px 0 0; font-size: 0.93rem; color: var(--color-text-muted); }
.auth-card__resend { margin-top: 12px; }

/* --- Library ------------------------------------------------------------- */
.library__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 32px 0 20px;
}
.library__head h1 { margin: 0; font-size: 1.7rem; }
.new-board-form { display: flex; gap: 8px; flex-wrap: wrap; }
.new-board-form input { width: 230px; }
.board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    margin-bottom: 40px;
}
.board-tile {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.board-tile__title { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; color: var(--color-text); }
.board-tile__title:hover { color: var(--color-primary); text-decoration: none; }
.board-tile__meta { display: flex; gap: 10px; align-items: center; font-size: 0.88rem; color: var(--color-text-muted); flex-wrap: wrap; }
.board-tile__code {
    font-weight: 700;
    letter-spacing: 0.12em;
    background: var(--color-accent-soft);
    border-radius: 6px;
    padding: 2px 8px;
    color: var(--color-text);
}
.board-tile__actions { display: flex; gap: 10px; margin-top: auto; padding-top: 6px; }
.board-tile--archived { background: var(--color-bg); border-style: dashed; }
.board-tile__dates {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 14px;
    padding-top: 8px;
    border-top: 1px solid var(--color-border);
    font-size: 0.75rem;
    color: var(--color-text-muted);
}
.pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid var(--color-border);
}
.pill--open { background: #eef7f1; border-color: #bfdcc9; color: #2f7d4f; }
.pill--frozen { background: #ebf1f9; border-color: #bfd1e8; color: var(--color-frozen); }
.pill--closed { background: #fbeeec; border-color: #e9c6c2; color: #b8453a; }
.empty-hint {
    text-align: center;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 40px 20px;
    margin-bottom: 40px;
}

/* --- Pricing -------------------------------------------------------------- */
.pricing { padding: 40px 0 24px; }
.pricing__title { text-align: center; margin: 0 0 8px; font-size: 1.9rem; }
.pricing__subtitle { text-align: center; color: var(--color-text-muted); margin: 0 0 34px; }
/* Sits between subtitle and cards, so the subtitle's bottom margin moves here. */
.pricing__subtitle:has(+ .pricing__invoice) { margin-bottom: 10px; }
.pricing__invoice { text-align: center; font-weight: 700; margin: 0 auto 34px; max-width: 680px; }
.pricing__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
    max-width: 760px;
    margin: 0 auto;
}
.price-card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
    text-align: center;
}
.price-card--pro { border-color: var(--color-primary); }
.price-card__badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--color-primary); color: #fff;
    border-radius: 999px; padding: 3px 14px;
    font-size: 0.78rem; font-weight: 700;
}
.price-card__name { margin: 0 0 6px; font-size: 1.2rem; }
.price-card__price { font-family: var(--font-display); font-size: 2.6rem; font-weight: 800; line-height: 1; }
.price-card__currency { font-size: 0.85rem; font-weight: 600; color: var(--color-text-muted); margin-left: 6px; }
.price-card__period, .price-card__alt { color: var(--color-text-muted); font-size: 0.9rem; }
.price-card__features { list-style: none; padding: 0; margin: 20px 0; text-align: left; }
.price-card__features li { padding: 6px 0 6px 26px; position: relative; font-size: 0.95rem; }
.price-card__features li::before {
    content: '✓'; position: absolute; left: 0; color: var(--color-primary); font-weight: 700;
}
.price-card__buttons { display: flex; flex-direction: column; gap: 8px; }
.price-card__current { display: block; font-weight: 700; color: var(--color-primary); }
.price-card__soon, .price-card__expiry { display: block; color: var(--color-text-muted); font-size: 0.9rem; }
.pricing__note { max-width: 680px; margin: 32px auto 0; text-align: center; font-size: 0.87rem; color: var(--color-text-muted); }

/* --- Account & legal ------------------------------------------------------- */
.panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
    margin: 28px 0;
}
.panel h1, .panel h2 { margin-top: 0; }
.data-list { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; }
.data-list dt { font-weight: 600; color: var(--color-text-muted); }
.data-list dd { margin: 0; }
.legal { max-width: 760px; margin: 0 auto; }
.legal h2 { margin-top: 32px; font-size: 1.2rem; }
.legal p, .legal li { color: var(--color-text); }
.legal-box {
    margin: 24px 0;
    padding: 4px 24px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}
.legal-box h2 { margin-top: 18px; }
.legal-box li { margin-bottom: 6px; }

/* --- Error pages ------------------------------------------------------------ */
.error-page { text-align: center; padding: 70px 20px; }
.error-page h1 { font-size: 1.8rem; margin: 0 0 10px; }
.error-page p { color: var(--color-text-muted); }

@media (max-width: 640px) {
    .hero { padding-top: 40px; }
    .site-footer__inner { flex-direction: column; align-items: flex-start; }
}

/* --- Account extras ---------------------------------------------------- */
.plan-line { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.pill--pro { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.plan-expiry, .hint { color: var(--color-text-muted); font-size: 0.9rem; }
.panel .hint { margin: 10px 0 0; }
.library__folder { font-size: 1.1rem; margin: 26px 0 10px; color: var(--color-text-muted); }
details.panel summary { cursor: pointer; font-weight: 600; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form select { width: auto; }
/* The shared settings fields, laid out for a page instead of a side panel. */
.defaults-form { max-width: 560px; }
.defaults-form .settings-section h3 { font-size: 1.05rem; margin: 18px 0 10px; }
.defaults-form__actions { margin-top: 22px; }
#defaults .btn-link { margin-top: 14px; font-size: 0.9rem; }

/* --- Admin: Pro by hand ------------------------------------------------ */
.admin-search { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 20px 0 6px; max-width: 560px; }
.admin-search input { flex: 1; min-width: 0; }
.admin-table-wrap {
    overflow-x: auto; margin: 12px 0 28px;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.admin-table th, .admin-table td { padding: 10px 14px; text-align: left; vertical-align: middle; border-top: 1px solid var(--color-border); }
.admin-table thead th { border-top: 0; font-size: 0.82rem; color: var(--color-text-muted); font-weight: 600; white-space: nowrap; }
.admin-table tbody tr:hover { background: color-mix(in srgb, var(--color-primary) 4%, transparent); }
.admin-table__account { min-width: 200px; }
.admin-table__account strong, .admin-table__account .hint { display: block; overflow-wrap: anywhere; }
.admin-table__date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.admin-table .pill + .hint { margin-left: 6px; }
.admin-table__actions { display: flex; align-items: center; gap: 8px; }
.admin-table__grant { display: flex; align-items: center; gap: 8px; }
/* Not confirmed yet: set apart, so it is not mistaken for a customer. */
.admin-table tr.admin-row--unverified { background: #fdf6e3; }
.admin-table tr.admin-row--unverified:hover { background: #fbefcf; }
.pill--unverified { background: #fbefcf; border-color: #ecd79a; color: #7a5a12; }
.admin-filter { margin: 4px 0 14px; }
.admin-filter a { padding: 6px 12px; font-size: 0.88rem; color: var(--color-text); border-right: 1px solid var(--color-border); background: var(--color-surface); }
.admin-filter a:last-child { border-right: none; }
.admin-filter a:hover { background: var(--color-bg); text-decoration: none; }
.admin-filter a[aria-current="page"] { background: var(--color-primary); color: #fff; }
.admin-table__grant input[type=date] { width: auto; padding: 6px 10px; }

/* --- Board settings form -------------------------------------------------
   Shared by the settings panel of a board and the defaults on the account
   page (templates/board/settingsfields.php). */
/* Settings: three sections, each with its own heading, a line in between. */
.settings-section + .settings-section {
    border-top: 1px solid var(--color-border);
    margin-top: 22px;
}
.settings-sublabel { font-weight: 600; font-size: 0.92rem; margin: 14px 0 8px; }

/* The «i» after a setting. Its explanation hangs below the whole row, full
   width — anchored to the little circle it would run out of the panel. */
.switch-row,
.field-label { position: relative; }
.field-label { display: flex; align-items: center; gap: 6px; margin: 14px 0 6px; }
.field-label label { margin: 0; }
.info {
    flex: none;
    width: 17px;
    height: 17px;
    margin-top: 1px;
    padding: 0;
    border: 1.5px solid var(--color-text-muted);
    border-radius: 50%;
    background: none;
    color: var(--color-text-muted);
    font: italic 700 11px/1 Georgia, serif;
    cursor: help;
}
.info::before { content: 'i'; }
.info:hover,
.info:focus-visible { border-color: var(--color-primary); color: var(--color-primary); }
.info__tip {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 5;
    padding: 8px 10px;
    border-radius: var(--radius-sm, 6px);
    background: #2f3a33;
    color: #fff;
    font-size: 0.84rem;
    font-weight: 400;
    line-height: 1.4;
    box-shadow: 0 4px 14px rgba(30, 30, 20, 0.2);
}
.info:hover + .info__tip,
.info:focus-visible + .info__tip,
.info.is-open + .info__tip { display: block; }
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}
.settings-grid select { width: 100%; }

.preset-row { display: flex; gap: 8px; flex-wrap: wrap; }
.preset {
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 999px;
    padding: 5px 13px 5px 6px;
    cursor: pointer;
    font: inherit;
    font-size: 0.88rem;
}
.preset:hover { border-color: var(--color-primary); }
.preset__swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.15); }
.switch-row { display: flex; align-items: flex-start; gap: 9px; margin: 10px 0; }
.switch-row input { width: auto; margin-top: 3px; }
.switch-row label { margin: 0; font-weight: 500; font-size: 0.93rem; }

/* --- Tooltip (app.js) ----------------------------------------------------- */
.tooltip {
    position: fixed;
    z-index: 1000;
    max-width: 260px;
    padding: 5px 9px;
    border-radius: 5px;
    background: #2f3a33;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.35;
    box-shadow: 0 3px 10px rgba(30, 30, 20, 0.22);
    pointer-events: none;
}
.tooltip[hidden] { display: none; }

/* --- Version (templates/layout/version.php) ------------------------------ */
.app-version {
    margin: 28px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
    font-size: 0.78rem;
    color: var(--color-text-muted);
}
/* On a page of its own: bottom right, no rule above. */
.app-version--page { border-top: none; text-align: right; margin-top: 40px; }
