﻿/*
  app.css
  Purpose: Visual styling for 7-step wizard. Minimal, responsive, accessible.
  Avalonia-friendly: uses system fonts, CSS variables, light/dark themes.
*/

/* ---------- Variables & themes ---------- */
:root {
    /* Base */
    --bg-gradient-a: #eff6ff;
    --bg-gradient-b: #ffffff;
    --bg-gradient-c: #f5f3ff;
    --text-900: #0f172a; /* slate-900 */
    --text-800: #1f2937; /* gray-800 */
    --text-700: #334155; /* slate-700 */
    --text-600: #475569; /* slate-600 */
    --text-500: #64748b; /* slate-500 */

    --surface: #ffffff;
    --surface-weak: #f8fafc;
    --surface-weak-2: #f1f5f9;
    --border: #e5e7eb;
    --primary: #3b82f6;
    --primary-strong: #2563eb;
    --accent: #7c3aed;
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --badge-green-bg: #ecfdf5;
    --badge-green-border: #bbf7d0;
    --badge-green-text: #065f46;
    --badge-amber-bg: #fffbeb;
    --badge-amber-border: #fde68a;
    --badge-amber-text: #92400e;
    --badge-blue-bg: #eff6ff;
    --badge-blue-border: #bfdbfe;
    --badge-blue-text: #1e40af;
    --badge-purple-bg: #f5f3ff;
    --badge-purple-border: #ddd6fe;
    --badge-purple-text: #6d28d9;
    --shadow-sm: 0 2px 8px rgba(2,6,23,.04);
    --shadow-md: 0 4px 16px rgba(2,6,23,.06);
    --shadow-lg: 0 6px 16px rgba(2,6,23,.08);
    /* Buttons */
    --btn-bg: #f8fafc;
    --btn-color: var(--text-900);
    --btn-border: var(--border);
    /* Progressbar */
    --progress-bg: var(--border);
    --progress-fill: linear-gradient(90deg, var(--primary), var(--accent));
}

/* Dark theme */
html[data-theme="dark"] {
    --bg-gradient-a: #0b1020;
    --bg-gradient-b: #0f1424;
    --bg-gradient-c: #171a2b;
    --text-900: #e5e7eb;
    --text-800: #d1d5db;
    --text-700: #cbd5e1;
    --text-600: #94a3b8;
    --text-500: #94a3b8;
    --surface: #161a26;
    --surface-weak: #121624;
    --surface-weak-2: #0f1422;
    --border: #293042;
    --badge-green-bg: #0d2a1a;
    --badge-green-border: #134e33;
    --badge-green-text: #a7f3d0;
    --badge-amber-bg: #2b230b;
    --badge-amber-border: #735d17;
    --badge-amber-text: #fde68a;
    --badge-blue-bg: #0b1b2f;
    --badge-blue-border: #203a5b;
    --badge-blue-text: #bfdbfe;
    --badge-purple-bg: #1b1430;
    --badge-purple-border: #3e2f73;
    --badge-purple-text: #ddd6fe;
    --shadow-sm: 0 2px 8px rgba(0,0,0,.25);
    --shadow-md: 0 4px 16px rgba(0,0,0,.3);
    --shadow-lg: 0 6px 16px rgba(0,0,0,.35);
    --btn-bg: #1f2435;
    --btn-color: #e5e7eb;
    --btn-border: #2a3246;
    --progress-bg: #2a3246;
}

/* ---------- Reset + base ---------- */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    color: var(--text-900);
    background: linear-gradient(135deg, var(--bg-gradient-a) 0%, var(--bg-gradient-b) 45%, var(--bg-gradient-c) 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Page layout */
.page {
    min-height: 100vh;
    padding: 24px;
    max-width: 1100px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 24px;
}

.title-gradient {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 8px;
    background: linear-gradient(90deg, var(--primary-strong), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.subtitle {
    margin: 0;
    font-size: 16px;
    color: var(--text-600);
}

/* Steps */
.steps {
    margin: 20px 0 16px;
    display: grid;
    place-items: center;
}

.steps-inner {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}

.step-dot {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    background: #e2e8f0;
    color: #64748b;
    transition: all .2s ease;
    border: 1px solid var(--border);
}

    .step-dot.is-active {
        background: var(--primary);
        color: #fff;
    }

/* Caption */
.steps-caption {
    font-size: 12px;
    color: var(--text-500);
}

/* Card */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: 18px;
}

.card-content {
    padding: clamp(18px, 3vw, 32px);
}

/* Typography helpers */
.h2 {
    font-size: clamp(20px, 3vw, 24px);
    font-weight: 800;
    margin: 0;
}

.lead {
    color: var(--text-600);
    margin-top: 4px;
}

/* Grid */
.grid {
    display: grid;
    gap: 12px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0,1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0,1fr));
}

@media (max-width: 960px) {
    .grid-3 {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

@media (max-width: 640px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Cards selectable */
.card-sm {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: all .2s ease;
    cursor: pointer;
}

    .card-sm:hover {
        box-shadow: var(--shadow-lg);
        transform: translateY(-1px);
    }

    .card-sm.active {
        outline: 2px solid #f59e0b;
        background: var(--badge-amber-bg);
    }

    .card-sm.blue.active {
        outline: 2px solid var(--primary);
        background: var(--badge-blue-bg);
    }

    .card-sm.green.active {
        outline: 2px solid var(--success);
        background: var(--badge-green-bg);
    }

    .card-sm.disabled {
        filter: grayscale(1);
        opacity: .5;
        cursor: not-allowed;
        pointer-events: none;
    }

    /* Inline content inside small card */
    .card-sm .center {
        text-align: center;
        padding: 18px;
    }

.icon-xl {
    font-size: 38px;
    margin-bottom: 6px;
}

.title-sm {
    font-weight: 700;
    font-size: 18px;
}

.desc-sm {
    color: var(--text-500);
    font-size: 13px;
}

/* Badge */
.badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-700);
    background: var(--surface-weak);
}

    .badge.secondary {
        background: var(--surface-weak-2);
        color: var(--text-900);
    }

    .badge.green {
        background: var(--badge-green-bg);
        border-color: var(--badge-green-border);
        color: var(--badge-green-text);
    }

    .badge.amber {
        background: var(--badge-amber-bg);
        border-color: var(--badge-amber-border);
        color: var(--badge-amber-text);
    }

    .badge.blue {
        background: var(--badge-blue-bg);
        border-color: var(--badge-blue-border);
        color: var(--badge-blue-text);
    }

    .badge.purple {
        background: var(--badge-purple-bg);
        border-color: var(--badge-purple-border);
        color: var(--badge-purple-text);
    }

/* Info / Summary blocks */
.info {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--badge-green-border);
    background: var(--badge-green-bg);
    color: var(--badge-green-text);
    font-size: 14px;
}

    .info.blue {
        border-color: var(--badge-blue-border);
        background: var(--badge-blue-bg);
        color: var(--badge-blue-text);
    }

    .info.yellow {
        border-color: var(--badge-amber-border);
        background: var(--badge-amber-bg);
        color: var(--badge-amber-text);
    }

    .info.gray {
        border-color: var(--border);
        background: var(--surface-weak);
        color: var(--text-700);
    }

/* Form controls */
.input-num {
    font: inherit;
    font-weight: 800;
    font-size: clamp(28px, 4vw, 40px);
    text-align: center;
    width: 140px;
    background: transparent;
    border: none;
    color: var(--primary-strong);
    outline: 2px solid transparent;
    border-radius: 8px;
}

    .input-num:focus {
        outline-color: #93c5fd;
    }

/* Split stats (3) */
.stats3 {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0,1fr));
}

.stat {
    text-align: center;
    background: var(--surface-weak);
    padding: 14px;
    border-radius: 12px;
}

    .stat .label {
        color: var(--text-700);
        font-weight: 600;
    }

    .stat .value {
        font-size: 13px;
        color: var(--text-500);
    }

/* Progress block */
.progress {
    background: linear-gradient(90deg, var(--badge-blue-bg), var(--badge-purple-bg));
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.progressbar {
    width: 100%;
    height: 10px;
    background: var(--progress-bg);
    border-radius: 999px;
    overflow: hidden;
}

    .progressbar > div {
        height: 100%;
        width: 0%;
        background: var(--progress-fill);
        transition: width .25s ease;
    }

/* Dots indicators */
.dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

    .dot.green {
        background: var(--success);
    }

    .dot.yellow {
        background: var(--warning);
    }

    .dot.red {
        background: var(--danger);
    }

/* Flex helpers */
.flex {
    display: flex;
    align-items: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.flex-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Buttons */
.btn {
    --btn-bg-local: var(--btn-bg);
    --btn-color-local: var(--btn-color);
    --btn-border-local: var(--btn-border);
    appearance: none;
    border: 1px solid var(--btn-border-local);
    background: var(--btn-bg-local);
    color: var(--btn-color-local);
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .2s;
}

    .btn:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-lg);
    }

    .btn:disabled {
        opacity: .55;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

.btn-outline {
    background: var(--surface);
}

.btn-primary {
    --btn-bg-local: var(--primary);
    --btn-color-local: #fff;
    --btn-border-local: var(--primary);
}

.btn-gradient {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.btn-icon {
    margin-right: 8px;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.nav-right {
    display: flex;
    gap: 10px;
}

/* Lists and small blocks */
.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: var(--surface-weak);
    border-radius: 10px;
    border: 1px solid var(--border);
}

    .row .meta {
        font-size: 12px;
        color: var(--text-500);
    }

    .row .title {
        font-size: 14px;
        font-weight: 600;
    }

/* Helpers */
.hidden {
    display: none !important;
}

.m0 {
    margin: 0;
}

.mt8 {
    margin-top: 8px;
}

.mt12 {
    margin-top: 12px;
}

.mt16 {
    margin-top: 16px;
}

.mt24 {
    margin-top: 24px;
}

.center {
    text-align: center;
}

.small {
    font-size: 12px;
    color: var(--text-500);
}

.big {
    font-size: 44px;
    font-weight: 800;
    color: var(--success);
}

.red {
    color: var(--danger);
}

.green {
    color: var(--success);
}

.blue {
    color: var(--primary-strong);
}

.px12 {
    padding: 0 12px;
}
