/* PACTUM Holdingstiftelse — Design System
   Aesthetic: Refined legal professionalism meets Nordic minimalism.
   Palette: Deep teal + warm stone + crisp white.
   Typography: DM Serif Display (headings) + DM Sans (body). */

:root {
    --color-primary: #1a3a4a;
    --color-primary-light: #2a5a6a;
    --color-primary-dark: #0d2530;
    --color-accent: #c8965a;
    --color-accent-light: #e8b87a;
    --color-bg: #faf9f7;
    --color-bg-card: #ffffff;
    --color-bg-muted: #f0eeeb;
    --color-text: #1a1a1a;
    --color-text-muted: #6b6560;
    --color-text-light: #9a9590;
    --color-border: #e5e2de;
    --color-border-focus: var(--color-primary);
    --color-success: #2d7a4f;
    --color-success-bg: #edf7f0;
    --color-warning: #b8860b;
    --color-warning-bg: #fdf6e3;
    --color-danger: #a0382e;
    --color-danger-bg: #fdf0ee;

    --font-heading: 'DM Serif Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, sans-serif;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);

    --max-width: 1140px;
    --max-width-narrow: 680px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

/* Nav */
.main-nav {
    background: var(--color-primary-dark);
    color: white;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.nav-logo { text-decoration: none; color: white; display: flex; align-items: baseline; gap: 0.5rem; }
.logo-text { font-family: var(--font-heading); font-size: 1.4rem; letter-spacing: 0.05em; }
.logo-sub { font-size: 0.8rem; opacity: 0.6; font-weight: 400; }
.nav-actions { display: flex; align-items: center; gap: 1.25rem; }
.nav-link { color: rgba(255,255,255,0.8); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.15s; }
.nav-link:hover { color: white; }
.nav-link--muted { opacity: 0.5; }
.nav-user { font-size: 0.85rem; opacity: 0.6; }

/* Main */
.main-content { min-height: calc(100vh - 60px - 100px); }

/* Footer */
.main-footer {
    background: var(--color-primary-dark);
    color: rgba(255,255,255,0.5);
    padding: 2rem 1.5rem;
    font-size: 0.85rem;
    text-align: center;
}
.footer-inner { max-width: var(--max-width); margin: 0 auto; }
.footer-inner p { margin: 0.25rem 0; }

/* Container */
.container { max-width: var(--max-width); margin: 0 auto; padding: 2rem 1.5rem; }
.container--narrow { max-width: var(--max-width-narrow); }

/* Cards */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 1.5rem; }
.card__title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--color-primary-dark);
}
.card__subtitle { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 1.5rem; }

/* Typography */
h1 { font-family: var(--font-heading); font-size: 2rem; color: var(--color-primary-dark); margin-bottom: 0.5rem; }
h2 { font-family: var(--font-heading); font-size: 1.5rem; color: var(--color-primary-dark); margin-bottom: 0.5rem; }
h3 { font-family: var(--font-heading); font-size: 1.2rem; color: var(--color-primary-dark); margin-bottom: 0.5rem; }
.page-header { margin-bottom: 2rem; }
.page-header p { color: var(--color-text-muted); font-size: 1.05rem; }

/* Forms */
.form-group { margin-bottom: 1.5rem; }
.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--color-text);
}
.form-hint { font-size: 0.82rem; color: var(--color-text-muted); margin-top: 0.25rem; }
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--color-text);
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: 0 0 0 3px rgba(26,58,74,0.1);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
}
.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--color-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    line-height: 1.4;
}
.btn--primary {
    background: var(--color-primary);
    color: white;
}
.btn--primary:hover { background: var(--color-primary-light); }
.btn--secondary {
    background: transparent;
    color: var(--color-primary);
    border: 1.5px solid var(--color-border);
}
.btn--secondary:hover { border-color: var(--color-primary); background: var(--color-bg-muted); }
.btn--danger { background: var(--color-danger); color: white; }
.btn--danger:hover { background: #8a2e25; }
.btn--sm { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn--block { width: 100%; justify-content: center; }
.btn-group { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead th {
    text-align: left;
    padding: 0.7rem 1rem;
    font-weight: 600;
    color: var(--color-text-muted);
    border-bottom: 2px solid var(--color-border);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
tbody td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}
tbody tr:hover { background: var(--color-bg-muted); }

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge--draft { background: var(--color-bg-muted); color: var(--color-text-muted); }
.badge--active { background: #e0f0ff; color: #1a5fa0; }
.badge--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge--success { background: var(--color-success-bg); color: var(--color-success); }
.badge--danger { background: var(--color-danger-bg); color: var(--color-danger); }

/* Wizard */
.wizard-steps {
    display: flex;
    gap: 0;
    margin-bottom: 2.5rem;
    counter-reset: step;
    padding: 0;
    list-style: none;
}
.wizard-step {
    flex: 1;
    text-align: center;
    position: relative;
    counter-increment: step;
    padding-top: 2.5rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
}
.wizard-step::before {
    content: counter(step);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-bg-muted);
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}
.wizard-step--active { color: var(--color-primary-dark); font-weight: 600; }
.wizard-step--active::before {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}
.wizard-step--done { color: var(--color-success); }
.wizard-step--done::before {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
    content: "✓";
}
/* Connector line between steps */
.wizard-step + .wizard-step::after {
    content: "";
    position: absolute;
    top: 16px;
    right: 50%;
    width: 100%;
    height: 2px;
    background: var(--color-border);
    z-index: -1;
}
.wizard-step--done + .wizard-step::after,
.wizard-step--active + .wizard-step::after { background: var(--color-success); }

/* Status timeline */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--color-border);
}
.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}
.timeline-item::before {
    content: "";
    position: absolute;
    left: -2rem;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-bg-muted);
    border: 2px solid var(--color-border);
}
.timeline-item--done::before { background: var(--color-success); border-color: var(--color-success); }
.timeline-item--active::before { background: var(--color-primary); border-color: var(--color-primary); }
.timeline-item__title { font-weight: 600; font-size: 0.9rem; }
.timeline-item__date { font-size: 0.8rem; color: var(--color-text-muted); }

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border-left: 4px solid;
}
.alert--info { background: #e0f0ff; border-color: #1a5fa0; color: #1a3a5a; }
.alert--success { background: var(--color-success-bg); border-color: var(--color-success); color: #1a4a2f; }
.alert--warning { background: var(--color-warning-bg); border-color: var(--color-warning); color: #5a4a1a; }
.alert--danger { background: var(--color-danger-bg); border-color: var(--color-danger); color: #5a1a15; }

/* Payment box */
.payment-box {
    background: var(--color-bg-muted);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.8;
}
.payment-box strong { color: var(--color-primary-dark); }

/* Computed value display */
.computed-value {
    background: var(--color-bg-muted);
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary-dark);
    display: inline-block;
}

/* Flag/warning indicator */
.flag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
}
.flag--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.flag--danger { background: var(--color-danger-bg); color: var(--color-danger); }

/* Landing page */
.hero {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: white;
    padding: 5rem 1.5rem;
    text-align: center;
}
.hero h1 { color: white; font-size: 2.8rem; margin-bottom: 1rem; }
.hero p { font-size: 1.2rem; opacity: 0.85; max-width: 600px; margin: 0 auto 2rem; }
.hero .btn { font-size: 1.1rem; padding: 1rem 2.5rem; }

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 3rem 0;
}
.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
}
.feature-card__icon { font-size: 2.5rem; margin-bottom: 1rem; }
.feature-card__title { font-family: var(--font-heading); font-size: 1.15rem; margin-bottom: 0.5rem; }
.feature-card__text { font-size: 0.9rem; color: var(--color-text-muted); }

.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    counter-reset: process;
}
@media (max-width: 768px) { .process-steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .process-steps { grid-template-columns: 1fr; } }
.process-step {
    counter-increment: process;
    position: relative;
    padding: 1.5rem;
    padding-top: 3.5rem;
}
.process-step::before {
    content: counter(process);
    position: absolute;
    top: 0;
    left: 1.5rem;
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--color-accent);
    opacity: 0.6;
}
.process-step__title { font-weight: 700; margin-bottom: 0.3rem; }
.process-step__text { font-size: 0.9rem; color: var(--color-text-muted); }

/* Utility */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: 0.85rem; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.hidden { display: none; }

/* Responsive */
@media (max-width: 768px) {
    h1 { font-size: 1.6rem; }
    .hero h1 { font-size: 2rem; }
    .hero { padding: 3rem 1.5rem; }
    .card { padding: 1.5rem; }
    .wizard-steps { flex-wrap: wrap; }
    .wizard-step { font-size: 0.75rem; }
}
