Files
motor-de-encuestas/app/globals.css
2026-06-04 22:49:25 -03:00

550 lines
15 KiB
CSS

@import "tailwindcss";
/* ── Tokens ── */
:root {
/* ── Marca RE ── */
--color-re-teal: #43BBC8;
--color-re-dark: #494F4F;
--color-re-orange: #F8AD13;
--color-re-orange-intense: #EE761A;
--color-re-light: #E7E6E5;
--color-re-white: #FFFFFF;
/* ── Sistema (primario = teal RE) ── */
--color-bg: #f9fafb;
--color-surface: #ffffff;
--color-text: #111827;
--color-text-muted: #6b7280;
--color-primary: #43BBC8;
--color-primary-hover: #3DAAB6;
--color-primary-light: #e8f8fa;
--color-accent: #43BBC8;
--color-error: #b91c1c;
--color-error-bg: #fef2f2;
--color-border: #d1d5db;
--color-border-focus: #43BBC8;
--color-sensitive: #fef3c7;
--color-sensitive-border: #f59e0b;
--radius: 8px;
--shadow-card: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}
/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
margin: 0;
background: var(--color-bg);
color: var(--color-text);
font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
line-height: 1.6;
-webkit-font-smoothing: antialiased;
}
/* ── Skip link ── */
.skip-link {
position: absolute;
left: -9999px;
top: 4px;
z-index: 9999;
padding: 8px 16px;
background: var(--color-primary);
color: #fff;
border-radius: var(--radius);
font-weight: 600;
text-decoration: none;
}
.skip-link:focus { left: 4px; }
/* ── Screen reader only ── */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0,0,0,0);
white-space: nowrap;
border: 0;
}
/* ── Survey wrapper ── */
.survey-wrapper {
max-width: 720px;
margin: 0 auto;
padding: 0 16px 80px;
}
/* ── Survey header ── */
.survey-header {
padding: 32px 0 16px;
border-bottom: 2px solid var(--color-border);
margin-bottom: 16px;
}
.survey-title {
font-size: 1.5rem;
font-weight: 700;
margin: 0 0 8px;
color: var(--color-text);
}
.survey-anon-note {
margin: 0;
font-size: 0.875rem;
color: var(--color-text-muted);
}
/* ── Progress bar ── */
.survey-progress-sticky {
position: sticky;
top: 0;
z-index: 10;
background: var(--color-surface);
border-bottom: 1px solid var(--color-border);
padding: 8px 0;
}
.progress-bar-container {
display: flex;
align-items: center;
gap: 12px;
height: 8px;
position: relative;
}
.progress-bar-fill {
height: 8px;
background: var(--color-primary);
border-radius: 4px;
transition: width 0.3s ease;
flex-shrink: 0;
}
.progress-bar-label {
font-size: 0.75rem;
color: var(--color-text-muted);
white-space: nowrap;
position: absolute;
right: 0;
top: -18px;
}
/* ── Sections ── */
.survey-section {
margin-top: 32px;
}
.section-header { margin-bottom: 16px; }
.section-title {
font-size: 1.125rem;
font-weight: 700;
margin: 0 0 6px;
padding: 10px 14px;
background: var(--color-primary-light);
border-left: 4px solid var(--color-primary);
border-radius: 0 var(--radius) var(--radius) 0;
color: var(--color-primary-hover);
}
.section-sensitive-note {
font-size: 0.8125rem;
color: #92400e;
background: var(--color-sensitive);
border: 1px solid var(--color-sensitive-border);
border-radius: var(--radius);
padding: 8px 12px;
margin: 0;
}
/* ── Question wrapper ── */
.question-wrapper {
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--radius);
padding: 20px;
margin-bottom: 12px;
box-shadow: var(--shadow-card);
}
/* ── Fieldset (radio/checkbox/rating) ── */
.question-fieldset {
border: none;
padding: 0;
margin: 0;
min-width: 0;
}
.question-legend {
display: block;
font-size: 1rem;
font-weight: 600;
margin-bottom: 12px;
color: var(--color-text);
line-height: 1.4;
}
.required-mark { color: var(--color-error); }
/* ── Options list ── */
.options-list { display: flex; flex-direction: column; gap: 8px; }
.option-item {}
.option-label {
display: flex;
align-items: flex-start;
gap: 10px;
padding: 10px 12px;
border: 1.5px solid var(--color-border);
border-radius: var(--radius);
cursor: pointer;
transition: border-color 0.15s, background 0.15s;
line-height: 1.4;
}
.option-label:hover { border-color: var(--color-accent); background: var(--color-primary-light); }
.option-label:has(input:checked) {
border-color: var(--color-primary);
background: var(--color-primary-light);
font-weight: 500;
}
.option-disabled { opacity: 0.45; cursor: not-allowed; }
.option-disabled:hover { border-color: var(--color-border); background: transparent; }
.option-input {
margin-top: 2px;
flex-shrink: 0;
width: 18px;
height: 18px;
accent-color: var(--color-primary);
cursor: pointer;
}
.option-input:disabled { cursor: not-allowed; }
.option-text { flex: 1; }
/* ── Max select hint ── */
.max-select-hint {
font-size: 0.8125rem;
color: var(--color-text-muted);
margin: 0 0 10px;
}
/* ── Rating ── */
.rating-wrapper {
display: flex;
align-items: center;
gap: 12px;
flex-wrap: wrap;
}
.rating-label {
font-size: 0.8125rem;
color: var(--color-text-muted);
white-space: nowrap;
}
.rating-steps {
display: flex;
gap: 6px;
flex-wrap: wrap;
}
.rating-step { display: flex; }
.rating-input { /* hidden via sr-only */ }
.rating-dot {
display: flex;
align-items: center;
justify-content: center;
width: 44px;
height: 44px;
border: 2px solid var(--color-border);
border-radius: 50%;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: border-color 0.15s, background 0.15s, color 0.15s;
color: var(--color-text);
}
.rating-step:has(input:checked) .rating-dot {
background: var(--color-primary);
border-color: var(--color-primary);
color: #fff;
}
.rating-step:has(input:focus-visible) .rating-dot {
outline: 3px solid var(--color-border-focus);
outline-offset: 2px;
}
.rating-step:hover .rating-dot { border-color: var(--color-accent); background: var(--color-primary-light); }
.rating-step:has(input:checked):hover .rating-dot { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: #fff; }
/* ── Text short (single-line input) ── */
.text-short-input {
display: block;
width: 100%;
padding: 10px 12px;
border: 1.5px solid var(--color-border);
border-radius: var(--radius);
font-size: 1rem;
font-family: inherit;
line-height: 1.5;
transition: border-color 0.15s;
color: var(--color-text);
background: var(--color-surface);
}
.text-short-input:focus {
outline: none;
border-color: var(--color-border-focus);
box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
/* ── Textarea ── */
.text-area {
display: block;
width: 100%;
padding: 10px 12px;
border: 1.5px solid var(--color-border);
border-radius: var(--radius);
font-size: 1rem;
font-family: inherit;
line-height: 1.5;
resize: vertical;
transition: border-color 0.15s;
color: var(--color-text);
background: var(--color-surface);
}
.text-area:focus {
outline: none;
border-color: var(--color-border-focus);
box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
/* ── Field error ── */
.field-error {
margin: 6px 0 0;
font-size: 0.875rem;
color: var(--color-error);
display: flex;
align-items: center;
gap: 4px;
}
.field-error::before { content: '⚠'; }
/* ── Buttons ── */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 12px 28px;
border-radius: var(--radius);
font-size: 1rem;
font-weight: 600;
border: 2px solid transparent;
cursor: pointer;
transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
min-height: 44px;
text-decoration: none;
}
.btn:focus-visible {
outline: 3px solid var(--color-border-focus);
outline-offset: 2px;
}
.btn-primary {
background: var(--color-primary);
color: #fff;
}
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-secondary {
background: transparent;
color: var(--color-primary);
border-color: var(--color-primary);
}
.btn-secondary:hover { background: var(--color-primary-light); }
/* ── Form footer ── */
.form-footer {
padding: 24px 0 16px;
display: flex;
justify-content: flex-end;
}
/* ── Summary ── */
.summary-container {
max-width: 720px;
margin: 0 auto;
padding: 32px 16px 80px;
}
.summary-header { margin-bottom: 28px; }
.summary-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 8px; }
.summary-subtitle { color: var(--color-text-muted); margin: 0 0 12px; }
.summary-note {
font-size: 0.875rem;
background: var(--color-sensitive);
border: 1px solid var(--color-sensitive-border);
border-radius: var(--radius);
padding: 10px 14px;
margin: 0;
}
.summary-section-heading {
font-size: 1rem;
font-weight: 700;
padding: 8px 12px;
background: var(--color-primary-light);
border-left: 4px solid var(--color-primary);
border-radius: 0 var(--radius) var(--radius) 0;
margin: 24px 0 8px;
color: var(--color-primary-hover);
}
.summary-list { margin: 0; padding: 0; }
.summary-item {
border-bottom: 1px solid var(--color-border);
padding: 12px 0;
}
.summary-question {
font-size: 0.875rem;
color: var(--color-text-muted);
margin-bottom: 4px;
}
.summary-code {
font-weight: 700;
color: var(--color-primary);
margin-right: 4px;
}
.summary-answer {
font-size: 1rem;
font-weight: 500;
color: var(--color-text);
margin: 0;
}
.summary-actions {
padding-top: 28px;
display: flex;
justify-content: flex-start;
}
/* ── Geo select widget ── */
.geo-select-wrapper { display: flex; flex-direction: column; gap: 16px; }
.geo-select-group { display: flex; flex-direction: column; gap: 8px; }
.geo-select {
display: block; width: 100%;
padding: 10px 12px;
border: 1.5px solid var(--color-border); border-radius: var(--radius);
font-size: 1rem; font-family: inherit; background: var(--color-surface);
color: var(--color-text); cursor: pointer; appearance: auto;
transition: border-color 0.15s;
}
.geo-select:focus { outline: none; border-color: var(--color-border-focus); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.geo-select-disabled { opacity: 0.5; cursor: not-allowed; background: #f3f4f6; }
.geo-label-disabled { color: var(--color-text-muted); }
.geo-disabled-hint { font-size: 0.8125rem; font-weight: 400; color: var(--color-text-muted); }
/* ── Brand header ── */
.brand-header {
background: var(--color-primary-light); border-left: 4px solid var(--color-primary);
border-radius: 0 var(--radius) var(--radius) 0;
padding: 10px 14px; margin: 16px 0 0;
}
.brand-text { margin: 0; font-size: 0.875rem; color: var(--color-primary-hover); line-height: 1.5; }
/* ── Consent screen ── */
.consent-container { max-width: 720px; margin: 0 auto; padding: 32px 16px 80px; }
.consent-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 24px; }
.consent-section { margin-bottom: 24px; }
.consent-section-title { font-size: 1.0625rem; font-weight: 700; margin: 0 0 10px; }
.consent-list { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; display: flex; flex-direction: column; gap: 8px; }
.consent-anon-box {
background: var(--color-sensitive); border: 1px solid var(--color-sensitive-border);
border-radius: var(--radius); padding: 14px 16px; margin-bottom: 24px;
font-size: 0.9375rem; line-height: 1.6;
}
.consent-checkboxes { margin-bottom: 28px; display: flex; flex-direction: column; gap: 14px; }
.consent-checkbox-label {
display: flex; align-items: flex-start; gap: 12px;
padding: 14px 16px; border: 1.5px solid var(--color-border); border-radius: var(--radius);
cursor: pointer; transition: border-color 0.15s, background 0.15s; line-height: 1.5;
}
.consent-checkbox-label:has(input:checked) { border-color: var(--color-primary); background: var(--color-primary-light); }
.consent-checkbox-input { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; accent-color: var(--color-primary); cursor: pointer; }
.consent-checkbox-text { flex: 1; }
.consent-required-badge { display: inline-block; font-size: 0.75rem; font-weight: 600; color: var(--color-primary); background: var(--color-primary-light); padding: 1px 6px; border-radius: 4px; }
.consent-optional-badge { display: inline-block; font-size: 0.75rem; font-weight: 600; color: var(--color-text-muted); background: #f3f4f6; padding: 1px 6px; border-radius: 4px; }
.consent-footer { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.consent-required-hint { margin: 0; font-size: 0.875rem; color: var(--color-text-muted); }
.btn-disabled { opacity: 0.5; cursor: not-allowed; }
/* ── Thank you / error screens ── */
.thank-you-container, .error-container { max-width: 560px; margin: 80px auto; padding: 0 16px; }
.thank-you-title, .error-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 16px; }
.thank-you-body { color: var(--color-text-muted); line-height: 1.7; margin: 0 0 12px; }
/* ── No survey state ── */
.no-survey {
max-width: 480px;
margin: 80px auto;
text-align: center;
padding: 0 16px;
}
.no-survey-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 12px; }
.no-survey-hint {
font-size: 0.875rem;
background: #f3f4f6;
border-radius: var(--radius);
padding: 12px 16px;
text-align: left;
font-family: 'Courier New', monospace;
margin-top: 16px;
}
/* ── Loading skeleton ── */
.loading-wrapper {
max-width: 720px;
margin: 0 auto;
padding: 32px 16px;
}
.skeleton { background: #e5e7eb; border-radius: var(--radius); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
/* ── Focus visible (global override) ── */
:focus-visible {
outline: 3px solid var(--color-border-focus);
outline-offset: 2px;
}
/* ── Mobile-first responsive ── */
@media (max-width: 480px) {
.survey-title { font-size: 1.25rem; }
.rating-wrapper { flex-direction: column; align-items: flex-start; }
.form-footer { justify-content: stretch; }
.btn { width: 100%; }
}
/* ── Survey header (marca RE) ── */
.survey-header-bar {
display: flex;
align-items: center;
gap: 14px;
padding: 16px 24px;
position: sticky;
top: 0;
z-index: 20;
}
.survey-header-logo { display: block; height: 48px; width: auto; flex-shrink: 0; }
.survey-header-title {
color: var(--color-re-white);
font-weight: 700;
font-size: 1rem;
letter-spacing: 0.08em;
text-transform: uppercase;
line-height: 1.2;
}
/* ── Survey footer ── */
.survey-footer-bar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 24px;
margin-top: 40px;
}
.survey-footer-group {
display: flex;
align-items: center;
gap: 8px;
}
.survey-footer-label {
color: rgba(255,255,255,0.7);
font-size: 0.75rem;
white-space: nowrap;
}
.survey-footer-logo { height: 32px; width: auto; display: block; }
/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}