@charset "UTF-8";
/* ── Variables ─────────────────────────────────────────── */
:root {
    --primary: #1a3a6b; --primary-light: #2557a7;
    --accent: #e8a000;  --success: #198754; --danger: #dc3545;
    --bg: #f0f4f8;      --white: #fff;      --gray: #6c757d;
    --gray-light: #e9ecef; --border: #ced4da; --text: #212529;
    --shadow: 0 4px 20px rgba(0,0,0,.10); --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', 'Segoe UI Emoji', 'Segoe UI Symbol',
                 'Apple Color Emoji', 'Noto Color Emoji', system-ui, sans-serif;
    background: var(--bg); color: var(--text); min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────── */
header { background: var(--primary); color: white; box-shadow: 0 2px 12px rgba(0,0,0,.2); }
.header-inner { max-width: 1100px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; gap: 16px; }
.logo-box { background: var(--accent); border-radius: 8px; padding: 8px 14px; font-weight: 800; font-size: 20px; color: var(--primary); }
header h1 { font-size: 18px; font-weight: 600; }
header p  { font-size: 12px; opacity: .7; margin-top: 2px; }
.header-nav { margin-left: auto; display: flex; gap: 16px; }
.header-nav a { color: rgba(255,255,255,.85); text-decoration: none; font-size: 13px; font-weight: 600; }
.header-nav a:hover { color: var(--accent); }

/* ── Footer ─────────────────────────────────────────────── */
footer { background: var(--primary); color: rgba(255,255,255,.6); padding: 14px 24px; text-align: center; font-size: 12px; margin-top: 40px; }

/* ── Main ───────────────────────────────────────────────── */
main { max-width: 860px; margin: 36px auto; padding: 0 16px 80px; }

/* ── Progress ───────────────────────────────────────────── */
.progress-wrap { background: white; border-radius: var(--radius); padding: 20px 28px; margin-bottom: 24px; box-shadow: var(--shadow); }
.progress-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--gray); margin-bottom: 10px; }
.progress-label span:last-child { font-weight: 600; color: var(--primary); }
.progress-track { height: 8px; background: var(--gray-light); border-radius: 99px; overflow: hidden; }
.progress-fill  { height: 100%; background: linear-gradient(90deg, var(--primary-light), var(--accent)); border-radius: 99px; transition: width .4s; }

/* ── Card ───────────────────────────────────────────────── */
.card { background: white; border-radius: var(--radius); padding: 32px 36px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; padding-bottom: 16px; border-bottom: 2px solid var(--gray-light); }
.card-icon { width: 44px; height: 44px; background: linear-gradient(135deg,var(--primary),var(--primary-light)); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.card-title    { font-size: 18px; font-weight: 700; color: var(--primary); }
.card-subtitle { font-size: 13px; color: var(--gray); margin-top: 2px; }

/* ── Forms ──────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 600; color: var(--primary); }
.req  { color: var(--danger); }
.form-control { padding: 10px 14px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; color: var(--text); background: white; width: 100%; transition: border-color .2s, box-shadow .2s; }
.form-control:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,87,167,.12); }
.form-control.readonly { background: #f8f9fa; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.val-msg { color: var(--danger); font-size: 11px; }

/* ── Radio Cards ────────────────────────────────────────── */
.radio-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 12px; }
.radio-card { border: 2px solid var(--border); border-radius: 10px; padding: 16px 12px; text-align: center; cursor: pointer; transition: all .2s; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.radio-card:hover, .radio-card.selected { border-color: var(--primary); background: #e8f0fe; }
.radio-card input { display: none; }
.rc-icon  { font-size: 28px; }
.rc-label { font-size: 13px; font-weight: 600; }

/* ── Alerts ─────────────────────────────────────────────── */
.alert { padding: 14px 18px; border-radius: 8px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 20px; }
.alert.info    { background: #e8f0fe; border-left: 4px solid var(--primary-light); color: var(--primary); }
.alert.warning { background: #fff8e1; border-left: 4px solid var(--accent); color: #7a5000; }

/* ── Buttons ────────────────────────────────────────────── */
.btn-row { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--gray-light); }
.btn { padding: 11px 28px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all .2s; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-outline  { background: white; color: var(--primary); border: 2px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); }
.btn-success  { background: var(--success); color: white; }
.btn-success:hover { background: #157347; }

/* ── Section divider ────────────────────────────────────── */
.section-divider { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--gray); margin: 22px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-light); }

/* ── Data rows ──────────────────────────────────────────── */
.data-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--gray-light); font-size: 14px; }
.data-row:last-child { border-bottom: none; }
.dr-label { color: var(--gray); font-weight: 500; width: 200px; flex-shrink: 0; }
.dr-value { font-weight: 600; text-align: right; }

/* ── Mode selector ──────────────────────────────────────── */
.mode-selector { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.mode-btn { flex: 1; min-width: 200px; padding: 20px; border: 2px solid var(--border); border-radius: var(--radius); background: white; cursor: pointer; text-align: left; transition: all .2s; display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.mode-btn:hover { border-color: var(--primary-light); box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.mb-icon    { font-size: 32px; }
.mb-text h3 { font-size: 15px; font-weight: 700; color: var(--primary); }
.mb-text p  { font-size: 12px; color: var(--gray); margin-top: 3px; }

/* ── Upload ─────────────────────────────────────────────── */
.upload-area { border: 2px dashed var(--border); border-radius: 10px; padding: 24px; text-align: center; cursor: pointer; transition: all .2s; background: var(--gray-light); }
.upload-area:hover { border-color: var(--primary-light); background: #e8f0fe; }
.upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-area p { font-size: 13px; color: var(--gray); }
.upload-area input[type=file] { width: 100%; opacity: 0; position: absolute; }

/* ── Map placeholder ────────────────────────────────────── */
.map-placeholder { background: #e8f0fe; border: 2px dashed var(--primary-light); border-radius: 10px; height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--primary-light); font-size: 14px; font-weight: 500; cursor: pointer; }

/* ── Checkbox ───────────────────────────────────────────── */
.checkbox-group { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }

/* ── Inspector badge ────────────────────────────────────── */
.inspector-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--primary); border-radius: 20px; padding: 4px 14px; font-size: 12px; font-weight: 700; margin-bottom: 16px; }

/* ── Recintos ───────────────────────────────────────────── */
.recinto-card { border: 1.5px solid var(--border); border-radius: 10px; background: #fafbfd; overflow: hidden; margin-bottom: 12px; }
.recinto-card-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--primary); color: white; }
.rc-title { font-size: 14px; font-weight: 700; }
.recinto-card-body { padding: 18px 16px; }
.recinto-body-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.btn-remove { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.4); color: white; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; font-weight: 600; }
.btn-remove:hover { background: rgba(220,53,69,.7); }
.btn-add-recinto { width: 100%; padding: 14px; border: 2px dashed var(--primary-light); border-radius: 10px; background: #f0f4ff; color: var(--primary-light); font-size: 14px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all .2s; margin-top: 4px; }
.btn-add-recinto:hover { background: #dce8ff; border-color: var(--primary); color: var(--primary); }
.recintos-empty { text-align: center; padding: 28px; color: var(--gray); font-size: 14px; border: 2px dashed var(--border); border-radius: 10px; margin-bottom: 12px; background: var(--gray-light); }
.empty-icon { font-size: 28px; margin-bottom: 8px; }
.recinto-m2-total { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; background: #e8f0fe; border: 1.5px solid var(--primary-light); border-radius: 8px; font-size: 15px; font-weight: 700; color: var(--primary); }
.recinto-m2-total span { font-size: 12px; font-weight: 500; color: var(--primary-light); }

/* ── Firma ──────────────────────────────────────────────── */
.firma-wrap { border: 2px solid var(--border); border-radius: 10px; overflow: hidden; background: white; }
.firma-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: var(--gray-light); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--gray); font-weight: 600; }
.firma-canvas { display: block; width: 100%; height: 160px; cursor: crosshair; touch-action: none; }
.btn-limpiar-firma { background: white; border: 1px solid var(--border); border-radius: 6px; padding: 4px 12px; font-size: 12px; cursor: pointer; color: var(--danger); font-weight: 600; }
.btn-limpiar-firma:hover { background: #fff0f0; border-color: var(--danger); }
.firma-hint { text-align: center; font-size: 11px; color: var(--gray); padding: 6px; background: #fafafa; border-top: 1px solid var(--gray-light); }

/* ── Success ────────────────────────────────────────────── */
.success-screen { text-align: center; padding: 48px 32px; }
.success-icon-wrap { width: 80px; height: 80px; background: linear-gradient(135deg,#28a745,#20c997); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 38px; margin: 0 auto 24px; color: white; box-shadow: 0 8px 24px rgba(40,167,69,.3); }
.success-screen h2 { font-size: 24px; color: var(--primary); margin-bottom: 10px; }
.success-screen p  { color: var(--gray); font-size: 15px; margin-bottom: 24px; }
.case-number { display: inline-block; background: var(--gray-light); border-radius: 8px; padding: 14px 28px; font-size: 22px; font-weight: 800; color: var(--primary); letter-spacing: 2px; margin-bottom: 28px; }

@media (max-width: 600px) {
    .form-grid { grid-template-columns: 1fr; }
    .card { padding: 20px 16px; }
    .mode-btn { min-width: 100%; }
    .recinto-body-grid { grid-template-columns: 1fr 1fr; }
}
