:root {
    --primary: #1e40af;
    --error: #dc2626;
    --bg: #f8fafc;
}

/* =========================
   BASE
========================= */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    padding: 20px;
    color: #1e293b;
    line-height: 1.6;
    margin: 0;
}

/* =========================
   CONTAINER
========================= */
.container {
    max-width: 850px;
    background: white;
    margin: 0 auto;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

/* =========================
   HEADINGS
========================= */
h1 {
    color: var(--primary);
    font-size: 1.6rem;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 20px;
    margin-bottom: 25px;
    text-transform: uppercase;
}

/* =========================
   INTRO / INSTRUCTIONS
========================= */
.intro-box {
    font-size: 0.95rem;
    color: #334155;
    margin-bottom: 30px;
    padding: 20px;
    background: #f0f7ff;
    border-radius: 8px;
    border-left: 6px solid var(--primary);
}

.instruction-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.instruction-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: var(--primary);
}

.rating-table {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    font-weight: bold;
    font-size: 0.85rem;
    color: #1e40af;
    background: #eff6ff;
    padding: 10px;
    border-radius: 4px;
}

/* =========================
   INFO GRID (FIXED)
========================= */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* =========================
   SECTIONS / QUESTIONS
========================= */
.section-title {
    background: var(--primary);
    color: white;
    padding: 12px 15px;
    font-weight: bold;
    margin-top: 40px;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.question-block {
    margin: 15px 0;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: 0.2s;
}

.question-block.unanswered {
    border-color: var(--error);
    background: #fef2f2;
}

.question-text {
    font-weight: 600;
    font-size: 1rem;
    display: block;
    margin-bottom: 12px;
    color: #0f172a;
}

/* =========================
   INPUTS (FIXED WIDTH)
========================= */
input[type="text"],
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    transition: 0.3s;
}

input[type="text"]:focus,
textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* =========================
   SCALE OPTIONS
========================= */
.scale-options {
    display: flex;
    gap: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.scale-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* =========================
   SIGNATURE
========================= */
canvas {
    border: 2px dashed #94a3b8;
    background: #fff;
    border-radius: 8px;
    width: 100%;
    height: 180px;
    cursor: crosshair;
    touch-action: none;
    margin-top: 10px;
}

/* =========================
   ERROR
========================= */
.error-toast {
    color: var(--error);
    font-weight: bold;
    display: none;
    margin: 20px 0;
    text-align: center;
    border: 2px solid var(--error);
    padding: 12px;
    border-radius: 8px;
    background: #fff1f2;
}

/* =========================
   BUTTONS
========================= */
.btn-group {
    margin-top: 40px;
    display: flex;
    gap: 15px;
}

.btn {
    flex: 1;
    padding: 18px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    text-transform: uppercase;
    transition: 0.2s;
}

.btn-save {
    background: #059669;
    color: white;
}

.btn-save:hover {
    background: #047857;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn-clear {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    flex: 0.4;
}

/* =========================
   MOBILE FIXES (IMPORTANT)
========================= */
@media (max-width: 768px) {
    .container {
        padding: 30px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-clear {
        flex: 1;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.3rem;
    }

    .question-text {
        font-size: 0.95rem;
    }

    .scale-options {
        gap: 15px;
    }
}
