/* ── Visit Wizard — shared styles ──────────────────────────────────────────── */

:root {
    --wiz-radius: 12px;
    --wiz-shadow: 0 2px 12px rgba(0,0,0,.08);
    --wiz-bg: #fff;
    --wiz-border: #e8e8e8;
    --wiz-accent: #5e64ff;
    --wiz-success: #28a745;
    --wiz-warning: #ffc107;
    --wiz-danger: #dc3545;
    --wiz-muted: #6c757d;
}

.wiz-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px 100px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wiz-page h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 4px; }
.wiz-page h2 { font-size: 1.25rem; font-weight: 600; margin: 0 0 16px; }
.wiz-page .subtitle { color: var(--wiz-muted); font-size: .95rem; margin-bottom: 28px; }

/* ── Cards ────────────────────────────────────────────────────────────────── */

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

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

.wiz-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wiz-card-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

/* ── Badges ───────────────────────────────────────────────────────────────── */

.wiz-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.4;
}
.wiz-badge-green  { background: #d4edda; color: #155724; }
.wiz-badge-yellow { background: #fff3cd; color: #856404; }
.wiz-badge-red    { background: #f8d7da; color: #721c24; }
.wiz-badge-blue   { background: #d1ecf1; color: #0c5460; }
.wiz-badge-grey   { background: #e9ecef; color: #495057; }

/* ── Editable fields ──────────────────────────────────────────────────────── */

.wiz-editable {
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 6px 10px;
    transition: border-color .2s, background .2s;
    cursor: text;
    min-height: 1.8em;
}
.wiz-editable:hover { background: #f8f9fa; }
.wiz-editable:focus {
    outline: none;
    border-color: var(--wiz-accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(94,100,255,.12);
}

.wiz-input, .wiz-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--wiz-border);
    border-radius: 8px;
    font-size: .9rem;
    transition: border-color .2s;
}
.wiz-input:focus, .wiz-select:focus {
    outline: none;
    border-color: var(--wiz-accent);
    box-shadow: 0 0 0 3px rgba(94,100,255,.12);
}

.wiz-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid var(--wiz-border);
    border-radius: 8px;
    font-size: .9rem;
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}
.wiz-textarea:focus {
    outline: none;
    border-color: var(--wiz-accent);
    box-shadow: 0 0 0 3px rgba(94,100,255,.12);
}

/* ── Table ────────────────────────────────────────────────────────────────── */

.wiz-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.wiz-table th {
    background: #f8f9fa;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--wiz-muted);
    padding: 10px 12px;
    border-bottom: 2px solid var(--wiz-border);
    text-align: left;
}
.wiz-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.wiz-table tr:last-child td { border-bottom: none; }
.wiz-table .wiz-input { padding: 6px 8px; font-size: .85rem; }

.wiz-btn-icon {
    width: 32px; height: 32px;
    border: none; background: none;
    cursor: pointer; border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .2s;
    color: var(--wiz-muted);
}
.wiz-btn-icon:hover { background: #f8d7da; color: var(--wiz-danger); }

.wiz-btn-add {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border: 1px dashed var(--wiz-border);
    background: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: .85rem;
    color: var(--wiz-muted);
    transition: all .2s;
    margin-top: 12px;
}
.wiz-btn-add:hover { border-color: var(--wiz-accent); color: var(--wiz-accent); background: #f0f1ff; }

/* ── Sticky bottom bar ────────────────────────────────────────────────────── */

.wiz-bottom-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--wiz-border);
    padding: 14px 24px;
    display: flex;
    justify-content: center;
    gap: 12px;
    z-index: 100;
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
}

.wiz-btn {
    padding: 10px 28px;
    border: none;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.wiz-btn-primary { background: var(--wiz-accent); color: #fff; }
.wiz-btn-primary:hover { background: #4a50e0; }
.wiz-btn-secondary { background: #f0f0f0; color: #333; }
.wiz-btn-secondary:hover { background: #e0e0e0; }

/* ── Header bar (results page) ────────────────────────────────────────────── */

.wiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--wiz-border);
}

.wiz-header-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    color: var(--wiz-muted);
    font-size: .9rem;
}
.wiz-header-meta span { display: flex; align-items: center; gap: 6px; }

/* ── Audio player ─────────────────────────────────────────────────────────── */

.wiz-audio-player {
    width: 100%;
    max-width: 400px;
    height: 40px;
    border-radius: 20px;
}

/* ── Two-column layout ────────────────────────────────────────────────────── */

.wiz-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media (max-width: 700px) {
    .wiz-grid-2 { grid-template-columns: 1fr; }
}

/* ── Recording page ───────────────────────────────────────────────────────── */

.wiz-record-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
}

.wiz-mic-btn {
    width: 120px; height: 120px;
    border-radius: 50%;
    border: none;
    background: var(--wiz-danger);
    color: #fff;
    font-size: 48px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 4px 24px rgba(220,53,69,.3);
    position: relative;
}
.wiz-mic-btn:hover { transform: scale(1.05); }
.wiz-mic-btn:active { transform: scale(.95); }

.wiz-mic-btn.recording {
    animation: mic-pulse 1.5s ease-in-out infinite;
}

@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,53,69,.4); }
    50% { box-shadow: 0 0 0 24px rgba(220,53,69,0); }
}

.wiz-timer {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: "SF Mono", "Fira Code", monospace;
    margin-top: 20px;
    color: #333;
}

.wiz-record-hint {
    color: var(--wiz-muted);
    margin-top: 12px;
    font-size: .95rem;
}

/* ── Processing page ──────────────────────────────────────────────────────── */

.wiz-processing-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.wiz-loader {
    position: relative;
    width: 100px; height: 100px;
    margin-bottom: 32px;
}

.wiz-loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--wiz-accent);
    animation: wiz-spin 1.2s linear infinite;
}
.wiz-loader-ring:nth-child(2) {
    inset: 10px;
    border-top-color: #a5a8ff;
    animation-duration: 1.8s;
    animation-direction: reverse;
}
.wiz-loader-ring:nth-child(3) {
    inset: 20px;
    border-top-color: #d0d2ff;
    animation-duration: 2.4s;
}

@keyframes wiz-spin { to { transform: rotate(360deg); } }

.wiz-steps {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
    text-align: left;
}

.wiz-steps li {
    padding: 10px 0;
    font-size: 1rem;
    color: var(--wiz-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color .3s;
}
.wiz-steps li.active { color: var(--wiz-accent); font-weight: 600; }
.wiz-steps li.done { color: var(--wiz-success); }

.wiz-step-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--wiz-border);
    flex-shrink: 0;
    transition: background .3s, transform .3s;
}
.wiz-steps li.active .wiz-step-dot {
    background: var(--wiz-accent);
    animation: dot-pulse .8s ease-in-out infinite alternate;
}
.wiz-steps li.done .wiz-step-dot { background: var(--wiz-success); transform: scale(1.2); }

@keyframes dot-pulse {
    from { transform: scale(1); }
    to { transform: scale(1.4); }
}

/* ── Field groups ─────────────────────────────────────────────────────────── */

.wiz-field-group {
    margin-bottom: 14px;
}
.wiz-field-label {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--wiz-muted);
    margin-bottom: 4px;
}

/* ── Confidence meter ─────────────────────────────────────────────────────── */

.wiz-confidence-bar {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
    overflow: hidden;
    margin-top: 6px;
}
.wiz-confidence-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .6s ease;
}
