:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #334155;
    --text-light: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
    font-family: Inter, system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

input, button, select, textarea { font-family: inherit; font-size: 1rem; }

.container { max-width: 800px; margin: 0 auto; padding: 20px; }

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all .2s;
    gap: 8px;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { transform: scale(.98); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--border); color: var(--text); }

.btn-success-active {
    background: var(--success);
    color: #fff;
    border: 2px solid var(--success);
}

.btn-danger-active {
    background: var(--danger);
    color: #fff;
    border: 2px solid var(--danger);
}

.form-group { margin-bottom: 16px; }

.label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--background);
    transition: border-color .2s;
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px #3b82f61a;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.nav-item {
    background: var(--surface);
    padding: 16px;
    border-radius: var(--radius);
    text-align: center;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    border: 2px solid transparent;
    transition: all .2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
}

.nav-item.active {
    border-color: var(--accent);
    color: var(--accent);
    background: #eff6ff;
}

/* Checklist */
.checklist-item {
    padding: 16px;
    background: #f1f5f9;
    border-radius: 8px;
    margin-bottom: 16px;
}

.checklist-text {
    margin-bottom: 12px;
    font-weight: 500;
}

.checklist-buttons {
    display: flex;
    gap: 12px;
}

.checklist-buttons .btn {
    flex: 1;
}

/* Signature */
.sig-container {
    border: 2px dashed var(--border);
    border-radius: 8px;
    height: 200px;
    background: white;
}

.sig-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Form row (completed list) */
.form-row {
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    margin-bottom: 16px;
}

.form-row h3 { font-weight: 600; }
.form-row p { font-size: 0.9rem; color: var(--text-light); }

.form-row-actions {
    display: flex;
    gap: 8px;
}

/* Flash messages */
.flash-success {
    background: #d1fae5;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-weight: 500;
}

/* Step badge */
.step-badge {
    padding: 4px 12px;
    background: #e0f2fe;
    color: #0369a1;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ID preview */
.id-preview {
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    height: 150px;
    width: 200px;
    background: #eee;
    display: none;
}

.id-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive */
@media (max-width: 600px) {
    .nav-grid { grid-template-columns: 1fr; gap: 8px; }
    .nav-item { flex-direction: row; padding: 12px; }
    .form-row { flex-direction: column; gap: 12px; align-items: flex-start; }
    .form-row-actions { width: 100%; }
    .form-row-actions .btn { flex: 1; }
}
