/**
 * Base: design tokens (tz/03 §1), reset, typography, layout, shared components.
 * Colours only through tokens.
 */

/* ==========================================================
 * Tokens
 * ========================================================== */
:root {
    --c-ink: #0b3d3f;
    --c-primary: #0e7c7b;
    --c-accent: #ffc93c;
    --c-accent-hover: #f2b91f;
    --c-bg: #f2faf8;
    --c-surface: #ffffff;
    --c-aqua: #d9f2ec;
    --c-aqua-soft: #e8f4f1;
    --c-switch: #e1ecea;
    --c-text-2: #2f5658;
    --c-text-3: #4b6466;
    --c-line: #c5dcd8;
    --c-line-soft: #dceae7;
    --c-on-dark: #cfe6e2;
    --c-teal-light: #3fc1b4;
    --c-note: #fff3cf;
    --c-error: #b3261e; /* form errors (tz v2 03 §10.5) */
    --c-ink-line: #2a5a5c; /* outlines on --c-ink surfaces (tz v2 03 §10.5) */
    --c-coral: #e86f5a; /* only the low cleanliness meter (tz/03 §10) */
    /* Messenger brand colours, darkened where needed for 3:1 with a white icon (floating contact buttons) */
    --c-brand-telegram: #1c87bd;
    --c-brand-viber: #7360f2;
    --c-brand-messenger: #0866ff;
    --c-brand-whatsapp: #128c7e;

    --font-head: 'Unbounded', system-ui, sans-serif;
    --font-body: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --container: 1240px;
    --gutter: 12px;
    --section-gap: 96px;
    --pad-block-sm: 20px; /* inner padding of every block (card, panel) on phones < 640px */

    --r-pill: 999px;
    --r-hero: 32px;
    --r-panel: 28px;
    --r-card: 24px;
    --r-sm: 16px;
    --r-btn: 14px;
    --r-control: 12px;
    --r-xs: 10px;

    --focus: 3px solid var(--c-ink);
    --focus-ring: 0 0 0 6px var(--c-surface);
}

@media (max-width: 639px) {
    :root {
        --section-gap: 64px;
    }
}

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

body,
h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
fieldset {
    margin: 0;
}

ul,
ol,
fieldset,
legend {
    padding: 0;
}

ul[class],
ol[class] {
    list-style: none;
}

fieldset {
    min-width: 0;
    border: 0;
}

img,
svg {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

/* ==========================================================
 * Base
 * ========================================================== */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    /* No grey/blue tap flash on touch screens (FAQ rows, buttons, checkboxes): elements have their own states. */
    -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--c-ink);
    background: var(--c-bg);
    overflow-x: hidden;
}

a {
    color: var(--c-primary);
}

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

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: var(--focus);
    outline-offset: 2px;
    box-shadow: var(--focus-ring);
}

:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.site-main:focus {
    outline: none;
}

/* ==========================================================
 * Typography
 * ========================================================== */
.h2,
.h3 {
    font-family: var(--font-head);
    font-weight: 700;
}

.h2 {
    font-size: clamp(28px, 3.4vw, 44px);
    line-height: 1.1;
    letter-spacing: -1px;
}

.h2--card {
    font-size: clamp(26px, 3vw, 38px);
}

.h3 {
    font-size: 26px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.lead {
    font-size: 18px;
    color: var(--c-text-2);
}

.muted {
    color: var(--c-text-3);
}

.small {
    font-size: 14px;
    line-height: 1.45;
}

.highlight {
    padding: 0 10px;
    color: inherit;
    background: var(--c-accent);
    border-radius: 12px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.highlight--sm {
    padding: 0 8px;
    border-radius: var(--r-xs);
}

.link-strong {
    font-size: 15px;
    font-weight: 600;
}

.note {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    background: var(--c-note);
    border-radius: var(--r-btn);
}

.note--small {
    font-size: 13px;
    font-weight: 400;
}

.prose > * + * {
    margin-top: 1em;
}

/* Dialog (popup) shell: <dialog class="modal"> + .modal__body, close button [data-dialog-close] */
.modal {
    width: min(760px, calc(100% - 24px));
    max-height: calc(100% - 24px);
    padding: 0;
    color: var(--c-ink);
    background: var(--c-bg);
    border: 0;
    border-radius: var(--r-panel);
    overscroll-behavior: contain;
}

.modal::backdrop {
    background: color-mix(in srgb, var(--c-ink) 55%, transparent);
}

.modal__body {
    position: relative;
    padding: clamp(20px, 4vw, 36px);
}

.modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: var(--c-ink);
    background: var(--c-surface);
    border: 0;
    border-radius: var(--r-pill);
    cursor: pointer;
}

.modal__close:hover {
    background: var(--c-aqua);
}

.modal__title {
    padding-right: 48px;
    font-family: var(--font-head);
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.modal__lead {
    margin-top: 10px;
    margin-bottom: 20px;
    color: var(--c-text-3);
}

/* Long texts: legal pages (inc/legal.php) and other page content */
.prose {
    max-width: 820px;
    line-height: 1.65;
    color: var(--c-text-2);
}

.prose h1,
.prose h2,
.prose h3 {
    color: var(--c-ink);
}

.prose h2 {
    margin-top: 2em;
    font-family: var(--font-head);
    font-size: clamp(19px, 2vw, 22px);
    line-height: 1.3;
}

.prose h3 {
    margin-top: 1.5em;
    font-size: 17px;
}

.prose ul,
.prose ol {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 22px;
}

.prose ul {
    list-style: disc;
}

.prose li::marker {
    color: var(--c-primary);
}

.prose a {
    color: var(--c-primary);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.prose strong {
    color: var(--c-ink);
}

.prose code {
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

.legal-meta {
    font-size: 14px;
    color: var(--c-text-3);
}

.prose .legal-requisites {
    padding: 20px 24px;
    background: var(--c-surface);
    border-radius: var(--r-sm);
}

@media (max-width: 639px) {
    .prose .legal-requisites {
        padding: var(--pad-block-sm);
    }
}

/* Missing data / to confirm: visible on purpose until filled in */
.legal-todo {
    padding: 0 4px;
    color: var(--c-ink);
    background: var(--c-note);
    border-radius: 4px;
}

.legal-table {
    overflow-x: auto;
    background: var(--c-surface);
    border-radius: var(--r-sm);
}

.legal-table table {
    width: 100%;
    min-width: 520px;
    font-size: 14px;
    border-collapse: collapse;
}

.legal-table th,
.legal-table td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--c-line-soft);
}

.legal-table thead th {
    color: var(--c-ink);
}

.legal-table__group th {
    color: var(--c-ink);
    background: var(--c-aqua-soft);
}

/* ==========================================================
 * Layout
 * ========================================================== */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section {
    padding-top: var(--section-gap);
}

.section--first {
    padding-top: 8px;
}

.section--last {
    padding-bottom: var(--section-gap);
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 36px;
}

.section-head__title {
    max-width: 620px;
}

.section-head__text {
    max-width: 380px;
    color: var(--c-text-3);
}

.panel {
    padding: clamp(24px, 4vw, 48px);
    background: var(--c-surface);
    border-radius: var(--r-panel);
}

@media (max-width: 639px) {
    .panel {
        padding: var(--pad-block-sm);
    }
}

.page-content {
    padding-top: 32px;
    padding-bottom: var(--section-gap);
}

/* ==========================================================
 * Buttons
 * ========================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    border: 0;
    border-radius: var(--r-btn);
    transition: background-color 0.15s;
}

.btn--lg {
    min-height: 56px;
    padding: 16px 24px;
}

.btn--block {
    display: flex;
    width: 100%;
}

.btn--primary {
    color: var(--c-surface);
    background: var(--c-primary);
}

.btn--primary:hover {
    color: var(--c-surface);
    background: var(--c-ink);
}

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

.btn--accent:hover {
    color: var(--c-ink);
    background: var(--c-accent-hover);
}

.btn--outline {
    min-height: 44px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    color: var(--c-ink);
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-control);
}

.btn--outline:hover {
    background: var(--c-aqua-soft);
}

/* ==========================================================
 * Small components
 * ========================================================== */
.pill-label--accent {
    font-weight: 700;
    background: var(--c-accent);
}

.pill-label {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    background: var(--c-surface);
    border-radius: var(--r-pill);
}

.icon-box {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    color: var(--c-primary);
    background: var(--c-aqua);
    border-radius: var(--r-sm);
}

.icon-box--accent {
    color: var(--c-ink);
    background: var(--c-accent);
}

/* Currency after a big price ("lei*") */
.price-cur {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0;
}

/* Number input + range (area) */
.input {
    height: 44px;
    padding: 0 12px;
    font-size: 16px;
    color: var(--c-ink);
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-xs);
}

.input--number {
    width: 76px;
    font-weight: 600;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

.input--number::-webkit-inner-spin-button,
.input--number::-webkit-outer-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.range {
    display: block;
    width: 100%;
    height: 28px;
    margin: 0;
    accent-color: var(--c-primary);
    cursor: pointer;
}

.range-scale {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--c-text-3);
}

.area-field__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.area-field__label {
    font-size: 15px;
    font-weight: 600;
}

.area-field__value {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--c-text-3);
}

/* Segmented control (mini calculator tabs) */
.segmented {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--c-aqua-soft);
    border-radius: var(--r-btn);
}

.segmented__tab {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    -webkit-hyphens: auto;
    hyphens: auto;
    overflow-wrap: break-word;
    padding: 10px 6px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--c-text-2);
    background: transparent;
    border: 0;
    border-radius: var(--r-xs);
}

.segmented__tab[aria-selected='true'] {
    color: var(--c-surface);
    background: var(--c-ink);
}

/* Inline variant ("what's included" type switcher): content width, bigger text */
.segmented--inline {
    display: inline-flex;
    flex-wrap: wrap;
    max-width: 100%;
    border-radius: var(--r-sm);
}

.segmented--inline .segmented__tab {
    flex: 0 1 auto;
    min-height: 48px;
    padding: 12px 18px;
    font-size: 15px;
    border-radius: var(--r-control);
}

/* Small variant with radio inputs (mini calculator dirt level) */
.segmented--sm .segmented__option {
    position: relative;
    flex: 1 1 0;
    cursor: pointer;
}

.segmented__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented--sm .segmented__option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text-2);
    border-radius: var(--r-xs);
}

.segmented__input:checked + span {
    color: var(--c-surface);
    background: var(--c-ink);
}

.segmented__input:focus-visible + span {
    outline: var(--focus);
    outline-offset: 2px;
    box-shadow: var(--focus-ring);
}

/* Pill tabs ("What's included") */
.pill-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.pill-tabs__tab {
    min-height: 48px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--c-ink);
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--r-pill);
}

.pill-tabs__tab[aria-selected='true'] {
    background: var(--c-accent);
    border-color: var(--c-accent);
}

/* Check list */
.check-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: var(--c-text-2);
}

.check-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.check-list__mark {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-top: 1px;
    color: var(--c-ink);
    background: var(--c-accent);
    border-radius: 8px;
}

.check-list__mark .icon {
    stroke-width: 3;
}

/* ==========================================================
 * Utilities
 * ========================================================== */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--c-surface);
    background: var(--c-ink);
    border-radius: var(--r-xs);
    transform: translateY(-200%);
}

.skip-link:focus {
    color: var(--c-surface);
    transform: none;
}
