/* Betongklossar – portalens stilmall.
   Formaterad för hand; ingen byggkedja. Ändra direkt i denna fil. */

:root {
    --ink: #172a27;
    --green: #24483e;
    --lime: #d6ec83;
    --paper: #f4f4ef;
    --line: #dce1d8;
    --field: #cbd3c8;
    --muted: #66776d;
    --control-h: 46px;
    --control-h-small: 38px;
    --radius: 8px;
    --gap: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

:focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 2px;
}

/* --- Ramverk ------------------------------------------------------------ */

header {
    padding: 22px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    border-bottom: 1px solid var(--line);
    gap: 20px;
}

.brand {
    font-size: 21px;
    font-weight: 900;
    letter-spacing: -1px;
}

.brand span {
    font-weight: 400;
}

nav {
    display: flex;
    gap: 25px;
    align-items: center;
}

nav form {
    margin: 0;
    display: flex;
}

main {
    max-width: 1240px;
    margin: auto;
    padding: 36px 24px 70px;
}

footer {
    padding: 35px 5%;
    border-top: 1px solid var(--line);
    font-size: 13px;
    color: #6a786c;
}

footer span {
    float: right;
}

/* --- Typografi ---------------------------------------------------------- */

h1,
h2,
h3 {
    line-height: 1.12;
    letter-spacing: -1px;
}

h1 {
    font-size: 48px;
    margin: 16px 0 24px;
}

h2 {
    font-size: 29px;
}

h3 {
    font-size: 22px;
}

p {
    margin: 12px 0;
}

.eyebrow {
    display: block;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 12px;
    font-weight: 800;
    color: #547466;
}

.meta {
    font-size: 14px;
    color: var(--muted);
}

.subtle {
    color: #718174;
    font-size: 13px;
}

/* --- Hero --------------------------------------------------------------- */

.hero {
    background: var(--green);
    color: white;
    border-radius: 22px;
    padding: 54px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 25px;
    overflow: hidden;
}

.hero h1 {
    font-size: 58px;
    max-width: 560px;
}

.hero .eyebrow {
    color: var(--lime);
}

.hero p {
    color: #d4e1d9;
    max-width: 440px;
}

.hero-art {
    position: relative;
    min-height: 230px;
    display: grid;
    place-items: center;
}

.hero-art svg {
    width: 100%;
    max-width: 390px;
}

/* Egen bild i public/images/ ersätter illustrationen. Bilden är urklippt mot
   genomskinlig bakgrund, så den ska rymmas i sin yta – inte beskäras. */
.hero-art img {
    width: 100%;
    max-width: 340px;
    max-height: 320px;
    object-fit: contain;
}

.pill,
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 30px;
    background: #e7eddf;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.5;
}

.hero .pill {
    color: var(--lime);
    background: #365a4d;
}

/* --- Ytor och rutnät ---------------------------------------------------- */

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}

.card,
.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
}

.card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-content {
    padding: 23px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card img,
.placeholder {
    width: 100%;
    height: 190px;
    object-fit: cover;
    background: #e5e8df;
    display: grid;
    place-items: center;
    flex: none;
}

.placeholder svg {
    height: 150px;
    width: 220px;
}

.card h3 {
    margin: 12px 0;
}

/* Priset trycks ned så att det ligger i linje över hela kortraden. */
.price {
    font-size: 23px;
    font-weight: 800;
    margin-top: auto;
    padding-top: 20px;
}

.price small {
    font-size: 12px;
    font-weight: normal;
}

.cols {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 28px;
    align-items: start;
}

.stack > * + * {
    margin-top: 22px;
}

.auth {
    max-width: 480px;
    margin: 30px auto;
}

.row {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
}

.two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 15px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.notice,
.errors {
    padding: 15px 24px;
    border-radius: 10px;
    margin-bottom: 20px;
    background: #e2efc9;
}

.errors {
    background: #ffe5db;
}

.empty {
    padding: 35px;
    color: #6a786c;
}

/* --- Formulär ----------------------------------------------------------- */

/* Etiketten är en kolumn: texten överst, fältet underst. Fältet får
   margin-top:auto så att fälten i en rutnätsrad hamnar på samma linje
   även när etiketttexten radbryts olika mycket. */
label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 var(--gap);
}

label > input,
label > select,
label > textarea {
    margin-top: auto;
}

input,
select,
textarea {
    display: block;
    width: 100%;
    min-width: 0;
    height: var(--control-h);
    padding: 0 12px;
    border: 1px solid var(--field);
    border-radius: var(--radius);
    background: white;
    color: var(--ink);
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.2;
    margin: 0;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #a8b6a6;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--green);
}

/* Egen pil så att listor får exakt samma höjd som textfält i alla webbläsare. */
select {
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23172a27' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 12px 8px;
    cursor: pointer;
}

textarea {
    height: auto;
    min-height: 110px;
    padding: 12px;
    line-height: 1.5;
    resize: vertical;
}

input[type="file"] {
    height: auto;
    padding: 11px 12px;
    line-height: 1.4;
    cursor: pointer;
}

input[type="month"],
input[type="datetime-local"],
input[type="date"] {
    /* Safari ger annars fälten en egen inre höjd. */
    padding-top: 0;
    padding-bottom: 0;
}

/* Kryssruta: etiketten ligger på rad i stället för kolumn. */
label.check {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    font-size: 15px;
}

label.check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: none;
    margin: 0;
    accent-color: var(--green);
    cursor: pointer;
}

input[type="checkbox"] {
    width: auto;
    height: auto;
}

form > button,
form > .button {
    margin-top: 4px;
}

/* --- Knappar ------------------------------------------------------------ */

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--control-h);
    padding: 0 21px;
    background: var(--green);
    color: white;
    border: 1px solid var(--green);
    border-radius: var(--radius);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    white-space: nowrap;
}

.button:hover,
button:hover {
    filter: brightness(1.12);
    text-decoration: none;
}

.button.small {
    height: var(--control-h-small);
    padding: 0 16px;
    font-size: 13px;
}

.secondary {
    background: #e8edde;
    border-color: #d5ddc8;
    color: var(--ink);
}

.link {
    height: auto;
    padding: 0;
    background: none;
    border: 0;
    color: inherit;
    font-weight: 400;
}

.link:hover {
    filter: none;
    text-decoration: underline;
}

/* --- Verktygsrad (sök, filter, rapport) --------------------------------- */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 15px;
    margin: 28px 0;
}

.toolbar label {
    flex: 1;
    min-width: 160px;
    margin-bottom: 0;
}

.toolbar button {
    flex: none;
    margin-top: 0;
}

/* --- Tabeller och listor ------------------------------------------------ */

.table-wrap {
    overflow: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
}

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

th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

td form {
    margin: 0;
}

td .button,
td button {
    height: var(--control-h-small);
    padding: 0 16px;
    font-size: 13px;
}

.message {
    border-bottom: 1px solid var(--line);
    padding: 15px 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.message p {
    margin: 0;
}

.details {
    max-height: 420px;
    object-fit: cover;
    width: 100%;
    border-radius: 16px;
}

details {
    margin: 20px 0;
}

summary {
    cursor: pointer;
    font-weight: 700;
}

svg.pagination {
    width: 20px;
}

/* --- Responsivt --------------------------------------------------------- */

@media (max-width: 800px) {
    header {
        align-items: start;
        flex-direction: column;
    }

    nav {
        gap: 16px;
        flex-wrap: wrap;
        font-size: 13px;
    }

    main {
        padding: 22px 16px;
    }

    .hero {
        padding: 30px;
        grid-template-columns: 1fr;
    }

    .hero h1,
    h1 {
        font-size: 38px;
    }

    .hero-art {
        min-height: 100px;
    }

    .hero-art svg {
        max-width: 220px;
    }

    .grid {
        grid-template-columns: 1fr 1fr;
    }

    .cols {
        grid-template-columns: 1fr;
    }

    .two {
        grid-template-columns: 1fr;
    }

    .row {
        align-items: start;
        flex-wrap: wrap;
    }
}

@media (max-width: 520px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .hero-art {
        display: none;
    }

    .toolbar label,
    .toolbar button {
        flex: 1 0 100%;
        width: 100%;
    }

    .actions .button,
    .actions button {
        flex: 1 0 100%;
    }
}
