/* ============================================================
   Virke Min side – prototype-styling
   Magenta-aksent som etterligner virke.no-paletten.
   ============================================================ */

:root {
    --primary: #9f00a7;
    --primary-dark: #7d0084;
    --primary-tint: #faf2fb;
    --text: #111111;
    --text-secondary: #555555;
    --text-muted: #888888;
    --border: #e3e3e3;
    --bg-light: #f6f4f7;
    --white: #ffffff;
    --footer-bg: #1a1a1a;
    --footer-text: #e5e5e5;
    --footer-muted: #9a9a9a;
    --radius: 4px;
    --radius-lg: 8px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --max-width: 1280px;
    --header-px: 32px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--white);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

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

/* ============================================================
   HEADER – to bånd: toppstripe (logo + søk) og hovedmeny
   ============================================================ */

.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    flex-shrink: 0;
}

.header-greeting {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.header-top-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px var(--header-px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 36px;
    width: auto;
}

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

.search {
    padding: 9px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 14px;
    width: 240px;
    font-family: var(--font);
    background: var(--bg-light);
}

.search:focus {
    outline: none;
    background: var(--white);
    border-color: var(--primary);
}

.header-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 12px;
}

.header-link:hover {
    color: var(--primary);
}

/* Hovedmeny under toppstripen */
.main-nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--header-px);
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.nav-list::-webkit-scrollbar {
    display: none;
}

.nav-list li {
    flex-shrink: 0;
}

.nav-list a {
    display: inline-block;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 16px 14px;
    border-bottom: 3px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-list a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* "Bli medlem"-knapp – tydelig CTA på enden av menyen */
.nav-list a.cta {
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    padding: 10px 20px;
    margin: 0 0 0 12px;
    font-weight: 600;
    border-bottom: none;
}

.nav-list a.cta:hover {
    background: var(--primary-dark);
    border-bottom: none;
}

/* ============================================================
   DEMO-BAR – tydelig avskilt fra Virke-stilen
   ============================================================ */

.demo-bar {
    background: var(--primary-tint);
    border-bottom: 1px solid var(--border);
}

.demo-bar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 10px var(--header-px);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.demo-label {
    background: var(--primary);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius);
    letter-spacing: 0.5px;
}

.demo-bar-inner label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.demo-bar-inner select {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--white);
    font-family: var(--font);
    color: var(--text);
    flex: 1;
    max-width: 520px;
    cursor: pointer;
}

/* ============================================================
   MAIN
   ============================================================ */

.page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 48px var(--header-px) 80px;
}

.hero {
    margin-bottom: 56px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.greeting {
    font-size: 40px;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.15;
    letter-spacing: -0.5px;
}

.member-meta {
    color: var(--text-secondary);
    margin: 0;
    font-size: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.meta-sep {
    color: var(--text-muted);
}

/* ============================================================
   ANBEFALT FOR DEG
   ============================================================ */

.block-header {
    margin-bottom: 28px;
}

.block-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}

.block-sub {
    color: var(--text-secondary);
    margin: 0;
    font-size: 15px;
}

.cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.07);
    border-color: var(--primary);
}

.card-type {
    display: inline-block;
    color: var(--primary);
    padding: 0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
    align-self: flex-start;
}

.card-title {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.3;
    letter-spacing: -0.2px;
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 16px;
    line-height: 1.55;
}

.card-reason {
    font-size: 14px;
    color: var(--text);
    margin: 0 0 20px;
    padding: 14px 16px;
    background: var(--primary-tint);
    border-radius: var(--radius);
    line-height: 1.5;
}

.card-reason::before {
    content: "Hvorfor for deg: ";
    font-weight: 700;
    color: var(--primary);
}

/* Format-knapper nederst i kortet */
.card-formats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: auto;
}

/* ============================================================
   KNAPPER
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
    line-height: 1;
}

.btn .material-symbols-rounded {
    font-size: 18px;
    line-height: 1;
}

.btn-primary {
    background: #d6007f;
    color: #ffffff;
    border-color: #d6007f;
}

.btn-primary:hover {
    background: #b8006c;
    border-color: #b8006c;
    color: #ffffff;
}

.btn-secondary {
    background: #ffffff;
    color: #d6007f;
    border-color: #d6007f;
}

.btn-secondary:hover {
    background: #fce4f1;
}

/* ============================================================
   AI-MODAL
   ============================================================ */

.ai-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    align-items: center;
    justify-content: center;
}

.ai-modal.open {
    display: flex;
}

.ai-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.ai-modal-dialog {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px 36px 36px;
    max-width: 440px;
    width: calc(100% - 40px);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.ai-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    border-radius: var(--radius);
    font-size: 20px;
}

.ai-modal-close:hover {
    color: var(--text);
    background: var(--bg-light);
}

.ai-modal-icon {
    font-size: 36px;
    color: #d6007f;
}

.ai-modal-msg {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: 1.4;
}

.ai-modal-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.55;
}

/* ============================================================
   REGENERER-KNAPP
   ============================================================ */

.regenerate-section {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

.regenerate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid #d6007f;
    border-radius: var(--radius);
    color: #d6007f;
    font-size: 13px;
    font-weight: 400;
    font-family: var(--font);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.regenerate-btn:hover {
    opacity: 1;
    background: #fce4f1;
}

.regenerate-btn:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.regenerate-btn .material-symbols-rounded {
    font-size: 16px;
}

.format-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    white-space: nowrap;
}

.format-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.format-btn-read {
    background: var(--primary-tint);
    color: var(--primary-dark);
    border: 1px solid rgba(159, 0, 167, 0.2);
}

.format-btn-watch {
    background: var(--primary);
    color: var(--white);
}

.format-btn-listen {
    background: var(--bg-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.format-btn-attend {
    background: var(--primary-dark);
    color: var(--white);
}

/* ============================================================
   LASTING & FEIL
   ============================================================ */

.loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    padding: 64px 24px;
    font-size: 16px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    margin: 0;
}

.error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
}

.error-message {
    color: var(--text);
    margin: 0 0 20px;
    font-size: 16px;
}

.retry-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
}

.retry-btn:hover {
    background: var(--primary-dark);
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    margin-top: 80px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 56px var(--header-px) 32px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 768px) {
    .footer-inner {
        grid-template-columns: 1.2fr 1fr 1fr;
    }
}

.footer-col h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 18px;
    color: var(--white);
}

.footer-col p,
.footer-col a {
    color: var(--footer-text);
    text-decoration: none;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 8px;
}

.footer-col a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.footer-address {
    color: var(--footer-muted);
    margin-top: 12px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px var(--header-px) 32px;
    border-top: 1px solid #333;
    color: var(--footer-muted);
    font-size: 13px;
}

.footer-bottom p {
    margin: 0;
}

/* ============================================================
   SURVEY-BLOKK
   ============================================================ */

skyra-survey {
    --skyra-primary-color: #d6007f;
    --skyra-primary-hover: #b8006c;
    --skyra-background: #ffffff;
    --skyra-text-color: #1a1a1a;
    --skyra-border-radius: 4px;
    --skyra-font-family: inherit;
    font-family: inherit;
}

skyra-survey::part(button-primary) {
    background-color: #d6007f;
    color: white;
    border-radius: 4px;
    padding: 10px 20px;
    font-weight: 500;
}

skyra-survey::part(button-primary):hover {
    background-color: #b8006c;
}

skyra-survey::part(button-secondary) {
    background-color: white;
    color: #d6007f;
    border: 1.5px solid #d6007f;
    border-radius: 4px;
    padding: 10px 20px;
}

skyra-survey::part(scale-button) {
    border-radius: 4px;
    padding: 12px 20px;
    font-weight: 500;
}

skyra-survey::part(scale-button-selected) {
    background-color: #d6007f;
    color: white;
}

/* ============================================================
   MOBIL
   ============================================================ */

@media (max-width: 767px) {
    :root {
        --header-px: 16px;
    }

    .greeting {
        font-size: 28px;
    }

    .member-meta {
        font-size: 14px;
    }

    .block-header h2 {
        font-size: 22px;
    }

    .page {
        padding: 32px var(--header-px) 56px;
    }
}
