* {
    box-sizing: border-box;
}

:root {
    --primary: #1d4ed8;
    --primary-dark: #1e3a8a;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --background: #f6f7f9;
    --white: #ffffff;
    --footer: #1f2937;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--background);
    color: var(--text);
}

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

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 24px;
}

.user-agent {
    max-width: 300px;
    word-break: break-word;
    font-size: 0.85rem;
}

.audit-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    background: #f3f4f6;
    color: #374151;
}

.audit-created {
    background: #dcfce7;
    color: #166534;
}

.audit-updated {
    background: #dbeafe;
    color: #1d4ed8;
}

.audit-deleted {
    background: #fee2e2;
    color: #b91c1c;
}

.audit-login {
    background: #f3f4f6;
    color: #4b5563;
}

.audit-error {
    background: #ffedd5;
    color: #c2410c;
}

/* Header/navigation */

.site-header {
    background: rgba(31, 41, 55, 0.92);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;

    backdrop-filter: blur(8px);    
}

.site-nav {
    width: min(96vw, 1700px);
    margin: 0 auto;
    padding: 26px 32px;

    display: flex;
    align-items: center;
    gap: 28px;
}

.site-brand {
    color: white;
    font-size: 1.6rem;
    font-weight: 700;
    white-space: nowrap;
}

.site-nav-links {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: clamp(18px, 2vw, 34px);
}

.site-nav-links a {
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
}

.site-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Hero */

.hero {
    min-height: 430px;
    background:
        linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.45)),
        url("/assets/images/hero.jpg");
    background-size: cover;
    background-position: center;
    color: white;
    display: flex;
    align-items: center;
}

.hero-content {
    max-width: 1180px;
    margin: 0 auto;
    padding: 80px 24px;
}

.hero h1 {
    font-size: 3.4rem;
    margin: 0 0 16px;
}

.hero p {
    max-width: 620px;
    font-size: 1.25rem;
    line-height: 1.6;
}

/* Content */

.page-title {
    margin-top: 0;
}

.card {
    background: var(--white);
    border-radius: 14px;
    padding: 26px;
    margin-bottom: 22px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

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

.card h2,
.card h3 {
    margin-top: 0;
}

.muted {
    color: var(--muted);
}

/* Forms */

form {
    margin-top: 16px;
}

label {
    display: block;
    margin-bottom: 16px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    max-width: 420px;
    padding: 10px 12px;
    margin-top: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

textarea {
    max-width: 760px;
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

button,
.button {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    cursor: pointer;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
}

button:hover,
.button:hover {
    opacity: 0.92;
    text-decoration: none;
}

.button-small {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.button-light {
    background: white;
    color: var(--primary-dark);
}

.button-secondary {
    background: #4b5563;
}

.button-danger {
    background: #dc2626;
}

.alert-error {
    color: #991b1b;
    background: #fee2e2;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-success {
    color: #166534;
    background: #dcfce7;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Tables */

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

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

th {
    background: #f9fafb;
    font-weight: 700;
}

tr:hover td {
    background: #f9fafb;
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-header {
    background: #1e3a8a;
    color: white;
    padding: 40px 0;
}

.admin-header h1 {
    margin: 0 0 10px;
}

.admin-header p {
    margin: 0;
    opacity: 0.9;
}

.admin-links {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.admin-links a {
    color: white;
    font-weight: 700;
    text-decoration: none;
}

.admin-links a:hover {
    text-decoration: underline;
}

/* Footer */

.site-footer {
    background: var(--footer);
    color: white;
    margin-top: 48px;
}

.site-footer p {
    margin: 6px 0;
    color: rgba(255,255,255,0.82);
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

/* Password fields */
.password-field {
    display: flex;
    align-items: stretch;
    max-width: 420px;
}

.password-field input[type="password"],
.password-field input[type="text"] {
    flex: 1;
    max-width: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    color: #0f172a;
    background-color: #ffffff;
    -webkit-text-fill-color: #0f172a;
}

.password-toggle-button {
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-left: 0;
    border-radius: 0 8px 8px 0;
    background: #f8fafc;
    color: #0f172a;
    cursor: pointer;
    font-size: 0.95rem;
}

.password-toggle-button:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.password-toggle-button:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Utilities */

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.sub-hero {
    min-height: 260px;
    background:
        linear-gradient(rgba(0,0,0,0.48), rgba(0,0,0,0.48)),
        url("/assets/images/hero.jpg");
    background-size: cover;
    background-position: center;
    color: white;
    display: flex;
    align-items: center;
}

.sub-hero-content {
    max-width: 1180px;
    margin: 0 auto;
    padding: 56px 24px;
    width: 100%;
}

.sub-hero h1 {
    font-size: 2.6rem;
    margin: 0 0 10px;
}

.sub-hero p {
    font-size: 1.15rem;
    margin: 0;
    max-width: 620px;
}

.button-group {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
}

/* ===== Security recommendation ===== */

.security-recommendation {
    border-left: 6px solid #f59e0b;
}

.security-recommendation h2 {
    margin-top: 0;
    margin-bottom: 12px;
}

.security-recommendation p {
    margin-bottom: 12px;
}

.security-recommendation .button {
    margin-top: 6px;
}

.security-recommendation .button {
    background: #f59e0b;
    color: white;
    margin-top: 6px;
}

.security-recommendation .button:hover {
    background: #d97706;
    opacity: 1;
}

/* ===== GDPR profilepage ===== */
.gdpr-consent .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.gdpr-consent .checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
    flex-shrink: 0;
}

.gdpr-consent .checkbox-label span {
    display: block;
}

/* ===== Startsida ===== */

.frontpage-grid {
    display: grid;
    grid-template-columns: 25% 50% 25%;
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

.frontpage-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.frontpage-photos {
    margin-top: 24px;
}

.frontpage-section {
    margin-bottom: 24px;
}

.frontpage-section:last-child {
    margin-bottom: 0;
}

.frontpage-section h2 {
    margin-top: 0;
}

.frontpage .card {
    padding: 20px;
}

.frontpage {
    font-size: 0.95rem;
}

.frontpage h2 {
    font-size: 1.4rem;
}

.frontpage h3 {
    font-size: 1.1rem;
}

.frontpage p,
.frontpage li,
.frontpage a {
    font-size: 0.95rem;
    line-height: 1.5;
}

.frontpage-contact-item {
    font-size: 0.92rem;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.frontpage-contact-item h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    line-height: 1.25;
}

.frontpage-contact-item p {
    margin: 2px 0;
    line-height: 1.35;
}

.frontpage-contact-item p:first-of-type {
    margin-top: 0;
}

.frontpage-contact-item p:last-child {
    margin-bottom: 0;
}

.frontpage-contact-item:last-child {
    border-bottom: none;
}

.frontpage-contact-line {
    margin: 0;
}

.frontpage-contact-line + .frontpage-contact-line {
    margin-top: 0;
}

.frontpage-links {
    list-style: none;
    padding-left: 0;
}

.frontpage-links li {
    margin-bottom: 8px;
}

.frontpage-links a {
    text-decoration: none;
}

.frontpage-links a:hover {
    text-decoration: underline;
}

.frontpage-list-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.frontpage-list-table td {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.frontpage-list-table td:first-child {
    width: 90px;
    white-space: nowrap;
    color: var(--muted);
    padding-right: 16px;
}

.frontpage-list-table td:last-child {
    width: auto;
}

.frontpage-list-table tr:last-child td {
    border-bottom: none;
}

/* Google Maps */

.frontpage-map {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 300px;
    overflow: hidden;
    border-radius: 12px;
}

.frontpage-map iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.code-example {
    max-width: 760px;
    font-family: Consolas, monospace;
    background: #f8fafc;
    color: #374151;
}

/* Photos Frontpage */

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

.frontpage-photo-grid img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
}

.frontpage-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 12px;
    background: #f1f5f9;
}

.frontpage-carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.frontpage-carousel-slide {
    display: none;
    position: relative;
    width: 100%;
    height: 100%;
}

.frontpage-carousel-slide.active {
    display: block;
}

.frontpage-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 12px;
}

.frontpage-carousel-caption {
    position: absolute;
    left: 16px;
    bottom: 16px;
    background: rgba(17, 24, 39, 0.75);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 700;
}

.frontpage-carousel-button {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 999px;
    font-size: 2rem;
    line-height: 1;
    padding: 0;
    background: rgba(17, 24, 39, 0.72);
}

.frontpage-carousel-prev {
    left: 14px;
}

.frontpage-carousel-next {
    right: 14px;
}

/* ==============================
   Expandable cards
   ============================== */

.expandable-card {
    cursor: pointer;
    transition: all .2s ease;
}

.expandable-card:hover {
    transform: translateY(-2px);
}

.expandable-content {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.expandable-card.active .expandable-content {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}

.expandable-card.active {
    border-left: 4px solid #2563eb;
}

/* Mobile */

@media (max-width: 850px) {
    .site-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .site-nav-links {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .site-nav-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .card-grid,
    .frontpage-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 2.4rem;
    }

    .footer-grid {
        flex-direction: column;
    }
}