:root {
    --primary: #0f172a;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --danger: #ef4444;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    padding: 20px 0;
}

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

.app-header {
    margin-bottom: 40px;
    text-align: left;
}

.app-header h1 {
    font-weight: 800;
    font-size: 2rem;
    color: var(--primary);
    letter-spacing: -0.025em;
}

.app-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Question List - Modern App Style */
.question-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.question-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.question-item:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.question-label {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-main);
    cursor: pointer;
    flex: 1;
    margin-right: 20px;
}

/* Custom Switch - Modernized */
.form-switch .form-check-input {
    width: 3rem !important;
    height: 1.5rem !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280, 0, 0, 0.25%29'/%3e%3c/svg%3e");
    background-color: #cbd5e1;
    border-color: transparent;
    cursor: pointer;
    transition: background-position 0.15s ease-in-out, background-color 0.15s ease-in-out;
}

.form-switch .form-check-input:focus {
    border-color: transparent;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

.form-switch .form-check-input:checked {
    background-color: var(--accent);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
}

/* Results Dashboard */
#result-container {
    display: none;
    margin-top: 60px;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    border: 1px solid var(--border);
}

.dashboard-title {
    font-weight: 800;
    font-size: 1.75rem;
    margin-bottom: 30px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.dashboard-card {
    background: #f1f5f9;
    border-radius: var(--radius);
    padding: 24px;
    height: 100%;
}

.intensity-bar-container {
    margin-bottom: 20px;
}

.intensity-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
}

.progress {
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 4px;
}

.pattern-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid #bfdbfe;
}

.flag-alert {
    background: #fef2f2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    border: 1px solid #fee2e2;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

/* Buttons */
.btn-action {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 14px 32px;
    font-weight: 700;
    border-radius: 10px;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.4);
}

.btn-action:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
    color: white;
}

.btn-export {
    background-color: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 12px 28px;
    font-weight: 700;
    border-radius: 10px;
    transition: all 0.2s;
}

.btn-export:hover {
    background-color: var(--primary);
    color: white;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .app-header h1 { font-size: 1.5rem; }
    .question-item { padding: 14px 16px; }
    .question-label { font-size: 0.95rem; }
    #result-container { padding: 24px; }
    .dashboard-card { margin-bottom: 20px; }
}

@media (min-width: 1400px) {
    .question-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1400px) {
    .app-container {
        max-width: 1400px;
    }
}

.toggle-3state {
    width: 90px;
    height: 28px;
    position: relative;
}

.toggle-input {
    display: none;
}

/* CONTAINER VISÍVEL */
.toggle-label {
    width: 100%;
    height: 100%;
    background: #cbd5e1;
    /* neutro */
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    display: block;
    overflow: hidden;
    transition: background 0.2s ease;
}

/* TEXTOS */
.toggle-label span {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: 700;
    color: white;
    opacity: 0;
    pointer-events: none;
}

.toggle-yes {
    left: 8px;
}

.toggle-no {
    right: 8px;
}

/* BOTÃO (50% exato) */
.toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: calc(50% - 4px);
    height: calc(100% - 4px);
    background: #fff;
    border-radius: 12px;
    transition: left 0.2s ease;
    z-index: 2;
}

/* NEUTRO */
.toggle-input[data-state="neutral"]+.toggle-label .toggle-knob {
    left: calc(25% + 2px);
}

/* SIM */
.toggle-input[data-state="yes"]+.toggle-label {
    background: #16a34a;
}

.toggle-input[data-state="yes"]+.toggle-label .toggle-knob {
    left: calc(50% + 2px);
}

.toggle-input[data-state="yes"]+.toggle-label .toggle-yes {
    opacity: 1;
}

/* NÃO */
.toggle-input[data-state="no"]+.toggle-label {
    background: #dc2626;
}

.toggle-input[data-state="no"]+.toggle-label .toggle-knob {
    left: 2px;
}

.toggle-input[data-state="no"]+.toggle-label .toggle-no {
    opacity: 1;
}

.app-footer {
    margin-top: 80px;
    padding: 24px 16px;
    border-top: 1px solid #e5e7eb;
    background-color: #f8fafc;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

.footer-disclaimer {
    margin-bottom: 10px;
    font-size: 10px;
    color: #94a3b8;
}

.footer-credits {
    font-size: 11px;
    color: #94a3b8;
}

.footer-credits a {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
}

.footer-credits a:hover {
    text-decoration: underline;
    color: #334155;
}