/* ============================================================
   SveaDok — Ren & inbjudande juridisk design
   Typografi: Inter (body), Playfair Display (rubriker)
   Palett: Off-white bakgrund, djup navy, varm guld-accent
   ============================================================ */

:root {
    --navy:        #1b2d4f;
    --navy-mid:    #2c4a7c;
    --navy-light:  #3d6494;
    --gold:        #c9a84c;
    --gold-light:  #e8c97a;
    --off-white:   #f7f5f0;
    --soft-gray:   #f0eee9;
    --border:      #e5e1d8;
    --text:        #1e1e1e;
    --text-muted:  #6b6b6b;
    --white:       #ffffff;
    --radius:      12px;
    --radius-sm:   8px;
    --shadow-sm:   0 1px 4px rgba(27,45,79,.06), 0 2px 8px rgba(27,45,79,.04);
    --shadow-md:   0 4px 16px rgba(27,45,79,.10), 0 2px 6px rgba(27,45,79,.06);
    --shadow-lg:   0 8px 32px rgba(27,45,79,.14);
}

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

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--navy);
    line-height: 1.25;
}

a { color: var(--navy-mid); text-decoration: none; }
a:hover { color: var(--navy); }

.py-6 { padding-top: 5rem; padding-bottom: 5rem; }
.min-vh-75 { min-height: 75vh; }


/* ============================================================
   NAVBAR
   ============================================================ */
.site-navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: .9rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--navy);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 1rem;
}

.brand-icon-sm {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: .8rem;
}

.brand-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    letter-spacing: -.3px;
    color: var(--navy);
}

.site-navbar .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: .9rem;
    padding: .4rem .8rem;
    border-radius: 6px;
    transition: color .2s, background .2s;
}

.site-navbar .nav-link:hover {
    color: var(--navy);
    background: var(--soft-gray);
}

.user-avatar-sm {
    width: 26px;
    height: 26px;
    background: var(--navy);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 600;
}


/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary-solid {
    background: var(--navy);
    color: var(--white) !important;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .875rem;
    padding: .6rem 1.4rem;
    transition: background .2s, transform .1s;
}
.btn-primary-solid:hover {
    background: var(--navy-mid);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: .875rem;
    padding: .6rem 1.4rem;
    transition: background .2s, border-color .2s;
}
.btn-ghost:hover {
    background: var(--soft-gray);
    border-color: var(--navy-light);
    color: var(--navy);
}

.btn-ghost-dark {
    background: rgba(255,255,255,.12);
    color: var(--white) !important;
    border: 1.5px solid rgba(255,255,255,.35);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: .875rem;
    padding: .6rem 1.4rem;
    transition: background .2s;
}
.btn-ghost-dark:hover {
    background: rgba(255,255,255,.22);
}

.btn-outline-neutral {
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--navy);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: .875rem;
    padding: .5rem 1.2rem;
    transition: background .2s, color .2s;
}
.btn-outline-neutral:hover {
    background: var(--navy);
    color: var(--white);
}


/* ============================================================
   HERO
   ============================================================ */
.hero-section {
    position: relative;
    background-image: url('/img/hero.jpg');
    background-size: cover;
    background-position: center 30%;
    min-height: 75vh;
    display: flex;
    align-items: center;
}

/* Platshållare-stil om bilden saknas */
.hero-section:not([style*="background-image"]) {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(27, 45, 79, 0.82) 0%,
        rgba(27, 45, 79, 0.55) 60%,
        rgba(27, 45, 79, 0.15) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 5rem 0;
}

.hero-badge {
    display: inline-block;
    background: var(--gold);
    color: var(--navy);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .3rem .8rem;
    border-radius: 4px;
    margin-bottom: 1.2rem;
}

.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 1.2rem;
}

.hero-lead {
    font-size: 1.05rem;
    color: rgba(255,255,255,.82);
    max-width: 480px;
    margin-bottom: 0;
}

.hero-trust {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.hero-trust span {
    color: rgba(255,255,255,.75);
    font-size: .8rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}


/* ============================================================
   SECTIONS
   ============================================================ */
.section-white { background: var(--white); }
.section-soft  { background: var(--off-white); }

.section-label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: .5rem;
}

.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    color: var(--navy);
    margin-bottom: 1rem;
}


/* ============================================================
   STEG-KORT (How it works)
   ============================================================ */
.step-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.8rem;
    text-align: center;
    transition: box-shadow .2s, transform .2s;
}
.step-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.step-number {
    width: 48px;
    height: 48px;
    background: var(--navy);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 auto;
}


/* ============================================================
   MALL-KORT (Index / startsida)
   ============================================================ */
.template-card {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: box-shadow .2s, transform .2s;
}
.template-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.template-card-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--soft-gray);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--navy);
}

.template-card-body { flex: 1; }


/* ============================================================
   MALL-KORT STOR (Documents/Index)
   ============================================================ */
.template-card-lg {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
}
.template-card-lg:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.template-card-lg-header {
    background: var(--soft-gray);
    padding: 2rem;
    text-align: center;
    font-size: 2.5rem;
    color: var(--navy);
    border-bottom: 1px solid var(--border);
}

.template-card-lg-body {
    padding: 1.5rem;
    flex: 1;
}

.template-card-lg-footer {
    padding: 1rem 1.5rem 1.5rem;
}

.badge-community {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    background: #e8f4fd;
    color: #1565c0;
    padding: .2rem .6rem;
    border-radius: 4px;
}


/* ============================================================
   FEATURE SPLIT (bild + text)
   ============================================================ */
.feature-image-wrap {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--soft-gray);
}

.feature-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--radius);
}

/* Platshållare som visas OVANPÅ om bilden inte laddas */
.feature-image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    background: var(--soft-gray);
    color: var(--text-muted);
    pointer-events: none;
    border-radius: var(--radius);
    border: 2px dashed var(--border);
}
/* Dölj platshållare när riktiga bilden är laddad */
.feature-image-wrap:has(.feature-image[src]:not([src=""])) .feature-image-placeholder {
    display: none;
}

.feature-image-placeholder i { font-size: 2.5rem; opacity: .4; }
.feature-image-placeholder span { font-size: .8rem; font-weight: 600; opacity: .5; font-family: monospace; }

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.feature-list li {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem 0;
    font-size: .9rem;
    border-bottom: 1px solid var(--border);
}
.feature-list li:last-child { border-bottom: none; }
.feature-list li i { color: var(--gold); font-size: 1rem; flex-shrink: 0; }


/* ============================================================
   BENEFIT-KORT
   ============================================================ */
.benefit-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.8rem;
    transition: box-shadow .2s, transform .2s;
}
.benefit-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.benefit-icon {
    width: 52px;
    height: 52px;
    background: var(--navy);
    color: var(--gold);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}


/* ============================================================
   CTA-SEKTION (med bakgrundsbild)
   ============================================================ */
.cta-section {
    position: relative;
    background-image: url('/img/trust-bg.jpg');
    background-size: cover;
    background-position: center;
    padding: 6rem 0;
}

.cta-section:not([style*="background-image"]) {
    background: var(--navy);
}

.cta-overlay {
    position: absolute;
    inset: 0;
    background: rgba(27, 45, 79, 0.78);
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: var(--white);
    margin-bottom: 1rem;
}

.cta-lead {
    color: rgba(255,255,255,.75);
    font-size: 1.05rem;
    margin-bottom: 2rem;
}


/* ============================================================
   SIDHUVUD (inre sidor)
   ============================================================ */
.page-header {
    position: relative;
    background-image: url('/img/page-header-bg.jpg');
    background-size: cover;
    background-position: center;
    padding: 4rem 0;
}

.page-header:not([style*="background-image"]) {
    background: var(--off-white);
}

.page-header-overlay {
    position: absolute;
    inset: 0;
    background: rgba(27, 45, 79, 0.60);
}

.page-header-content {
    position: relative;
    z-index: 1;
}

.page-header-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: var(--white);
    margin-bottom: .5rem;
}

.page-header-lead {
    color: rgba(255,255,255,.78);
    font-size: 1rem;
    margin: 0;
}


/* ============================================================
   DOKUMENT-VISNING & ADMIN
   ============================================================ */
.generated-doc {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Times New Roman', Times, serif;
    font-size: .95rem;
    line-height: 1.9;
    background: var(--off-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-height: 600px;
    overflow-y: auto;
}

.template-preview {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    font-size: .8rem;
    background: var(--off-white);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    max-height: 400px;
    overflow-y: auto;
    color: var(--text);
    border: 1px solid var(--border);
}


/* ============================================================
   FORMULÄR
   ============================================================ */
.form-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: .4rem;
}

.form-control {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    padding: .65rem .9rem;
    transition: border-color .2s, box-shadow .2s;
    color: var(--text);
}

.form-control:focus {
    border-color: var(--navy-light);
    box-shadow: 0 0 0 3px rgba(44, 74, 124, .1);
    outline: none;
}

.form-control-lg {
    font-size: 1.4rem;
    letter-spacing: 4px;
    font-weight: 700;
    text-align: center;
    padding: .8rem;
}


/* ============================================================
   INTEGRITETSPOLICY
   ============================================================ */
.legal-content h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    margin-top: 2.5rem;
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}

.legal-content p,
.legal-content li { color: var(--text-muted); }


/* ============================================================
   TOM TILLSTÅND
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 5rem 1rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 3rem; display: block; margin-bottom: 1rem; opacity: .4; }


/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: #0f1c30;
    color: rgba(255,255,255,.7);
}

.site-footer .brand-text { color: rgba(255,255,255,.9); }

.text-muted-light { color: rgba(255,255,255,.45); }

.footer-heading {
    font-family: 'Inter', sans-serif;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.5);
    margin-bottom: .8rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li { margin-bottom: .4rem; }
.footer-links a {
    color: rgba(255,255,255,.65);
    font-size: .875rem;
    transition: color .2s;
}
.footer-links a:hover { color: var(--white); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 1.5rem 0;
    color: rgba(255,255,255,.35);
    font-size: .82rem;
}


/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    border-radius: var(--radius);
    font-size: .9rem;
}
.alert-success { background: #f0faf4; color: #1a7a4a; border-color: #c3e6d1; }
.alert-danger  { background: #fdf3f3; color: #8b1a1a; border-color: #f0c8c8; }
.alert-info    { background: #f0f6ff; color: #1a4a8a; border-color: #c3d9f5; }
.alert-warning { background: #fffbf0; color: #7a5c00; border-color: #f0dfa0; }


/* ============================================================
   CARD OVERRIDE (Bootstrap)
   ============================================================ */
.card { border-color: var(--border) !important; border-radius: var(--radius) !important; }
.card-header { border-bottom-color: var(--border) !important; }


/* ============================================================
   RESPONSIVITET
   ============================================================ */
@media (max-width: 768px) {
    .hero-trust { gap: .75rem; }
    .generated-doc { padding: 1.2rem; font-size: .85rem; }
    .py-6 { padding-top: 3rem; padding-bottom: 3rem; }
}
