/* ── Customer Updater — Swiss Minimal ── */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300;1,9..40,400&family=Instrument+Serif:ital@0;1&display=swap');

:root {
    --bg: #F8F6F2;
    --bg-card: #FFFFFF;
    --text: #1A1A1A;
    --text-muted: #7A7570;
    --text-light: #A8A29E;
    --accent: #C8553D;
    --accent-soft: #C8553D1A;
    --border: #E8E4DE;
    --border-focus: #1A1A1A;
    --input-bg: transparent;
    --success: #3D7C5F;
    --success-soft: #3D7C5F12;
    --error: #C8553D;
    --error-soft: #C8553D12;
    --warning: #B8860B;
    --warning-soft: #B8860B12;
    --info: #4A6FA5;
    --info-soft: #4A6FA512;
    --radius: 2px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04);
    --font-body: 'DM Sans', sans-serif;
    --font-display: 'Instrument Serif', serif;
}

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

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Typography ── */

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; }
h1 { font-size: 2.25rem; line-height: 1.15; }
h2 { font-size: 1.5rem; line-height: 1.25; }
h3 { font-size: 1.25rem; line-height: 1.3; }

.section-label {
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* ── Layout ── */

.site-header {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.site-header .container {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.site-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text);
    text-decoration: none;
}

.site-logo span {
    color: var(--text-light);
    font-style: italic;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

.container--wide { max-width: 780px; }

main {
    flex: 1;
    padding: 3rem 0;
}

.site-footer {
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-light);
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

/* ── Card ── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem;
    animation: fadeUp 0.5s ease both;
}

.card + .card { margin-top: 1.5rem; }

.card-intro {
    color: var(--text-muted);
    font-size: 0.9375rem;
    margin-bottom: 2rem;
    line-height: 1.65;
}

/* ── Forms ── */

.field {
    margin-bottom: 1.75rem;
    position: relative;
}

.field label, label.field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="password"],
input[type="file"],
select,
textarea,
.form-control,
.form-select {
    width: 100%;
    padding: 0.75rem 0;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text);
    background: var(--input-bg);
    border: none;
    border-bottom: 1.5px solid var(--border);
    border-radius: 0;
    outline: none;
    transition: border-color 0.25s ease;
    appearance: none;
    -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus,
.form-control:focus, .form-select:focus {
    border-bottom-color: var(--border-focus);
    box-shadow: none;
}

input::placeholder, textarea::placeholder { color: var(--text-light); }

select, .form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A7570' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 1.5rem;
}

.field-error {
    font-size: 0.8125rem;
    color: var(--error);
    margin-top: 0.375rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* ── Radio / Toggle ── */

.radio-group {
    display: flex;
    gap: 0;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 0.25rem;
}

.radio-group label {
    flex: 1;
    text-align: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1.5px solid var(--border);
    margin: 0;
}

.radio-group label:last-child { border-right: none; }
.radio-group input { display: none; }
.radio-group input:checked + label,
.radio-group label:has(input:checked) {
    background: var(--text);
    color: #fff;
}

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--text);
    color: #fff;
    width: 100%;
}

.btn-primary:hover { background: #333; }

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
}

.btn-secondary:hover { border-color: var(--text); }

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-accent:hover { background: #b34a34; }

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
}

/* ── Alerts / Messages ── */

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    border: none;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert::before {
    content: '';
    flex-shrink: 0;
    width: 4px;
    height: 100%;
    min-height: 1.25rem;
    border-radius: 2px;
}

.alert-error, .alert-danger { background: var(--error-soft); color: var(--error); }
.alert-error::before, .alert-danger::before { background: var(--error); }

.alert-success { background: var(--success-soft); color: var(--success); }
.alert-success::before { background: var(--success); }

.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-warning::before { background: var(--warning); }

.alert-info { background: var(--info-soft); color: var(--info); }
.alert-info::before { background: var(--info); }

.alert .btn-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    padding: 0;
    line-height: 1;
}

/* ── Recap Table ── */

.recap-table {
    width: 100%;
    border-collapse: collapse;
}

.recap-table tr { border-bottom: 1px solid var(--border); }
.recap-table tr:last-child { border-bottom: none; }

.recap-table th {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: left;
    padding: 0.875rem 1rem 0.875rem 0;
    width: 180px;
    vertical-align: top;
}

.recap-table td {
    padding: 0.875rem 0;
    font-size: 0.9375rem;
}

/* ── Divider ── */

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* ── Step indicator ── */

.step-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-light);
}

.step-indicator .step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    font-weight: 600;
    font-size: 0.625rem;
}

.step-indicator .step.active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

.step-indicator .step-line {
    flex: 0 0 2rem;
    height: 1px;
    background: var(--border);
}

/* ── Mandate download box ── */

.mandate-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: var(--info-soft);
    border-radius: var(--radius);
    margin-top: 2rem;
}

.mandate-box-text {
    font-size: 0.875rem;
    color: var(--info);
    font-weight: 500;
}

/* ── Animations ── */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeUp 0.4s ease both; }
.fade-in-1 { animation-delay: 0.05s; }
.fade-in-2 { animation-delay: 0.1s; }
.fade-in-3 { animation-delay: 0.15s; }
.fade-in-4 { animation-delay: 0.2s; }

/* ── HTMX indicator ── */

.htmx-indicator {
    display: none;
    color: var(--text-light);
    font-size: 0.8125rem;
    padding: 0.5rem 0;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: inline-block; }

/* ── Responsive ── */

@media (max-width: 640px) {
    .card { padding: 1.5rem; }
    .field-row { grid-template-columns: 1fr; gap: 0; }
    h1 { font-size: 1.75rem; }
}
