/* ============================================================
   Modelkontrakt — Stylesheet
   Æstetik: warm cream, deep charcoal, terracotta accent
   ============================================================ */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    background: #F5F0E8;
    color: #1A1612;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.serif, h1, h2, h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-feature-settings: "ss01";
    font-weight: 500;
    letter-spacing: -0.02em;
}

.container {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 20px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top bar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #1A1612;
}
.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #1A1612;
    color: #F5F0E8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.brand-name {
    font-family: 'Fraunces', serif;
    font-size: 18px;
    font-weight: 600;
}
.nav-auth {
    display: flex;
    gap: 18px;
    font-size: 14px;
}
.nav-auth a {
    color: #1A1612;
    text-decoration: none;
    font-weight: 500;
}
.nav-auth a.muted { color: #8A7B66; }

/* Headings */
h1 {
    font-size: 32px;
    line-height: 1.1;
    margin: 0 0 8px 0;
    color: #1A1612;
}
h1.large { font-size: 38px; }
h2 { font-size: 22px; margin: 0 0 8px 0; }
.lede {
    color: #6B5D4A;
    font-size: 15px;
    margin: 0 0 28px 0;
    line-height: 1.5;
}

/* Eyebrow */
.eyebrow {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8A7B66;
    font-weight: 500;
    margin-bottom: 6px;
}

/* Progress bar */
.progress {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.progress-dot {
    flex: 1;
    height: 3px;
    background: #E0D7C7;
    border-radius: 2px;
    transition: background 0.3s;
}
.progress-dot.active { background: #1A1612; }

/* Forms */
.field { margin-bottom: 18px; }
label.label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #6B5D4A;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
label.label .req { color: #A0432C; }

input[type="text"], input[type="email"], input[type="tel"],
input[type="password"], input[type="url"], textarea, select {
    width: 100%;
    padding: 14px 16px;
    background: #FFFCF7;
    border: 1px solid #E0D7C7;
    border-radius: 10px;
    font-size: 16px;
    color: #1A1612;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus {
    border-color: #A0432C;
    box-shadow: 0 0 0 3px rgba(160, 67, 44, 0.1);
}
input::placeholder, textarea::placeholder { color: #B8AFA1; }
textarea {
    min-height: 200px;
    font-family: inherit;
    resize: vertical;
    line-height: 1.6;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.02em;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.1s, background 0.2s;
    font-family: inherit;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
    background: #1A1612;
    color: #F5F0E8;
}
.btn-primary:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.btn-secondary {
    background: transparent;
    color: #1A1612;
    border: 1px solid #D6CCB9;
}
.btn-secondary:active { background: rgba(0,0,0,0.04); }
.btn-danger {
    background: transparent;
    color: #A0432C;
    border: 1px solid #E0CFC5;
}
.btn-block { width: 100%; }
.btn-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    margin-top: 28px;
}
.btn-row.single { grid-template-columns: 1fr; }

/* Cards */
.card {
    background: #FFFCF7;
    border: 1px solid #E0D7C7;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 14px;
}
.card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.card-title {
    font-family: 'Fraunces', serif;
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}
.card-meta {
    font-size: 13px;
    color: #8A7B66;
    margin-top: 4px;
}
.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}
.card-actions .btn { padding: 10px 14px; font-size: 13px; }

/* Badge */
.badge {
    display: inline-block;
    background: #1A1612;
    color: #F5F0E8;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.badge-accent { background: #A0432C; }

/* Checkbox row */
.checkbox-row {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: #FFFCF7;
    border: 1px solid #E0D7C7;
    border-radius: 10px;
    cursor: pointer;
    align-items: flex-start;
    margin-bottom: 10px;
    transition: border-color 0.2s, background 0.2s;
    user-select: none;
}
.checkbox-row.checked {
    border-color: #A0432C;
    background: #FBF6EE;
}
.checkbox-box {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1.5px solid #B8AFA1;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    margin-top: 1px;
}
.checkbox-box.checked {
    background: #A0432C;
    border-color: #A0432C;
}
.checkbox-box.checked::after {
    content: "✓";
    color: white;
    font-size: 14px;
    font-weight: bold;
}
.checkbox-label-strong {
    font-weight: 500;
    font-size: 14px;
    color: #1A1612;
    margin-bottom: 2px;
}
.checkbox-label-sub {
    font-size: 13px;
    color: #6B5D4A;
}

/* Image upload */
.dropzone {
    border: 2px dashed #D6CCB9;
    border-radius: 14px;
    padding: 48px 24px;
    text-align: center;
    background: #FFFCF7;
    cursor: pointer;
}
.dropzone-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #F5F0E8;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 22px;
}
.dropzone-title {
    font-family: 'Fraunces', serif;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 4px;
}
.dropzone-sub {
    font-size: 13px;
    color: #8A7B66;
}
.preview-wrap {
    border-radius: 14px;
    overflow: hidden;
    background: #1A1612;
}
.preview-wrap img {
    width: 100%;
    display: block;
    max-height: 420px;
    object-fit: contain;
}
.preview-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding: 0 4px;
    font-size: 13px;
    color: #6B5D4A;
}
.preview-meta button {
    background: none;
    border: none;
    color: #A0432C;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
}

/* Contract preview */
.contract-preview {
    background: #FFFCF7;
    border: 1px solid #E0D7C7;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 20px;
}
.contract-preview .hero {
    background: #1A1612;
}
.contract-preview .hero img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
}
.contract-preview .body {
    padding: 20px;
}
.contract-preview .title {
    font-family: 'Fraunces', serif;
    font-size: 22px;
    font-weight: 500;
    margin: 4px 0;
}
.contract-preview .date {
    font-size: 13px;
    color: #8A7B66;
    margin-bottom: 20px;
}
.contract-preview .text {
    font-size: 14px;
    line-height: 1.65;
    color: #2A241D;
    white-space: pre-wrap;
    margin-bottom: 20px;
}
.contract-preview .parties {
    border-top: 1px solid #E0D7C7;
    padding-top: 16px;
    display: grid;
    gap: 14px;
    font-size: 13px;
}
.contract-preview .party-label {
    color: #8A7B66;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}
.contract-preview .party-data {
    color: #1A1612;
    line-height: 1.6;
}

/* Step view */
.step { display: none; animation: fadeIn 0.35s ease-out; }
.step.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Flash */
.flash {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
}
.flash-success { background: #E8F0E5; color: #2F5A2A; border: 1px solid #C4D8BE; }
.flash-error   { background: #FAE6E2; color: #8C2E1B; border: 1px solid #E8C0B8; }
.flash-info    { background: #FBF6EE; color: #6B5D4A; border: 1px solid #E0D7C7; }

/* Success page */
.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #1A1612;
    color: #F5F0E8;
    margin: 40px auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}
.center { text-align: center; }

/* Invitation link box */
.link-box {
    background: #FFFCF7;
    border: 1px solid #E0D7C7;
    border-radius: 10px;
    padding: 14px;
    font-family: monospace;
    font-size: 13px;
    word-break: break-all;
    margin-bottom: 12px;
    color: #2A241D;
}

/* Footer */
.footer {
    margin-top: auto;
    padding-top: 40px;
    text-align: center;
    font-size: 11px;
    color: #B8AFA1;
    letter-spacing: 0.05em;
}
.footer a { color: #B8AFA1; text-decoration: none; }
.footer-dot { margin: 0 6px; }

/* Hero (landing) */
.hero-section {
    padding: 32px 0 24px;
}
.hero-section h1 { font-size: 38px; line-height: 1.05; }
.choice-grid {
    display: grid;
    gap: 12px;
    margin-top: 28px;
}
.choice-card {
    background: #FFFCF7;
    border: 1px solid #E0D7C7;
    border-radius: 14px;
    padding: 22px;
    text-decoration: none;
    color: #1A1612;
    transition: border-color 0.2s, transform 0.1s;
    display: block;
}
.choice-card:active { transform: scale(0.99); }
.choice-card:hover { border-color: #A0432C; }
.choice-card .choice-title {
    font-family: 'Fraunces', serif;
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 6px;
}
.choice-card .choice-desc {
    font-size: 14px;
    color: #6B5D4A;
    line-height: 1.5;
}
.choice-card .choice-arrow {
    margin-top: 12px;
    font-size: 13px;
    color: #A0432C;
    font-weight: 500;
}

/* Step label */
.step-label {
    font-size: 12px;
    color: #8A7B66;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 500;
    margin-top: 10px;
    margin-bottom: 24px;
}

/* Helper text */
.help {
    font-size: 12px;
    color: #8A7B66;
    margin-top: 6px;
    line-height: 1.4;
}

/* Empty state */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: #8A7B66;
    font-size: 14px;
    background: #FFFCF7;
    border: 1px dashed #E0D7C7;
    border-radius: 14px;
}

@media (max-width: 380px) {
    h1 { font-size: 28px; }
    h1.large { font-size: 32px; }
    .container { padding: 0 16px 32px; }
}

/* ===== Stats ===== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.stat-card {
    background: #FFFCF7;
    border: 1px solid #E0D7C7;
    border-radius: 14px;
    padding: 20px;
}
.stat-number {
    font-family: 'Fraunces', serif;
    font-size: 36px;
    font-weight: 600;
    color: #1A1612;
    line-height: 1;
    letter-spacing: -0.02em;
}
.stat-label {
    margin-top: 8px;
    font-size: 13px;
    color: #6B5D4A;
    font-weight: 500;
}
.stat-sub {
    margin-top: 4px;
    font-size: 11px;
    color: #8A7B66;
    line-height: 1.4;
}
.stats-row {
    display: flex;
    gap: 16px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.stat-mini {
    display: flex;
    flex-direction: column;
    min-width: 80px;
}
.stat-mini-num {
    font-family: 'Fraunces', serif;
    font-size: 24px;
    font-weight: 600;
    color: #1A1612;
    line-height: 1;
}
.stat-mini-lbl {
    margin-top: 4px;
    font-size: 11px;
    color: #8A7B66;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
@media (max-width: 420px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-mini { min-width: 70px; }
    .stat-mini-num { font-size: 20px; }
}
