:root {
    --bg: #f5f5f7;
    --card: #ffffff;
    --accent: #4b7bec;
    --accent-soft: #e3ecff;
    --text-main: #1f2933;
    --text-muted: #6b7280;
    --border-radius: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text-main);
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.title-card {
    background: linear-gradient(135deg, #4b7bec, #6c5ce7);
    color: #fff;
    padding: 1.5rem 1.5rem 1.3rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    margin: 0 -1rem 1rem;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
}

.title-card h1 {
    margin: 0 0 .4rem;
    font-size: 1.5rem;
}

.title-card p {
    margin: 0;
    font-size: .95rem;
    opacity: .9;
}

form {
    margin-top: 1rem;
}

section {
    background: var(--card);
    padding: 1.2rem 1.2rem 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

section h2 {
    margin-top: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

section h2 span.badge {
    background: var(--accent-soft);
    color: var(--accent);
    font-size: .75rem;
    padding: 0.1rem .5rem;
    border-radius: 999px;
}

.field-group {
    margin-bottom: .75rem;
}

.field-group label {
    display: block;
    font-size: .9rem;
    margin-bottom: .2rem;
}

.field-group small {
    display: block;
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: .2rem;
}

input[type="text"],
textarea,
select {
    width: 100%;
    padding: .45rem .55rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: .9rem;
    font-family: inherit;
}

textarea {
    min-height: 60px;
    resize: vertical;
}

.inline-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
}

.likert-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

.likert-table th,
.likert-table td {
    padding: .35rem .25rem;
    text-align: center;
}

.likert-table th {
    font-weight: 500;
    color: var(--text-muted);
}

.likert-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.likert-table input[type="radio"] {
    transform: scale(1.1);
}

.options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: .9rem;
}

.options-row label {
    display: flex;
    align-items: center;
    gap: .3rem;
}

.consent-box {
    background: #f9fafb;
    border-radius: 10px;
    padding: .8rem .9rem;
    border: 1px solid #e5e7eb;
    font-size: .85rem;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: .75rem;
}

.consent-warning {
    color: #b91c1c;
    font-size: .85rem;
    margin-top: .35rem;
}

.submit-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

button[type="submit"] {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: .6rem 1.4rem;
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(59, 130, 246, .4);
}

button[type="submit"]:disabled {
    opacity: .6;
    box-shadow: none;
    cursor: not-allowed;
}

/* Likert: container scrollabil + coloană stângă sticky (util la scroll orizontal) */
.likert-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.likert-table th:first-child,
.likert-table td:first-child {
    position: sticky;
    left: 0;
    background: var(--card);
    z-index: 2;
}

@media (max-width: 640px) {
    .inline-inputs { grid-template-columns: 1fr; }

    .likert-wrap {
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        background: #fff;
        padding: .25rem;
    }

    .likert-wrap::after {
        content: "Glisați stânga/dreapta pentru toate opțiunile";
        display: block;
        font-size: .78rem;
        color: #6b7280;
        padding: .35rem .25rem .15rem;
    }

    .likert-table { min-width: 760px; }

    .likert-table th,
    .likert-table td { padding: .45rem .35rem; }

    .likert-table input[type="radio"] { transform: scale(1.25); }
}


@media print {
    body {
        background: #ffffff;
    }
    .title-card {
        box-shadow: none;
        border-radius: 0;
        margin: 0 0 1rem 0;
    }
    .container {
        max-width: 100%;
        padding: 1rem;
    }
    section {
        box-shadow: none;
        border: 1px solid #e5e7eb;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    .no-print,
    .submit-row {
        display: none !important;
    }
    button,
    input,
    textarea,
    select {
        box-shadow: none !important;
    }
}

/* Setare pagină A4 */
@page {
    size: A4;
    margin: 1.5cm;
}


.likert-mobile {
    display: none; /* default off; only mobile */
    margin-top: .45rem;
}

.likert-mobile .likert-item {
    margin: .85rem 0 1.05rem;
}

.likert-mobile .likert-item-title {
    font-weight: 600;
    margin: 0 0 .45rem;
}

.likert-scale {
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--n), 1fr);
    gap: 12px;
    padding: 18px 0 0; /* loc pt cifrele 1..N */
    align-items: center;
}

.likert-scale::before {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    top: calc(18px + 20px); /* aliniat cu centrul bilelor */
    height: 4px;
    background: #e5e7eb;
    border-radius: 999px;
}

/* ascundem radio real */
.likert-scale input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* cifrele 1..N de deasupra */
.likert-dot {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0 auto;
    border-radius: 999px;
    background: #eaf2ff;
    border: 2px solid #dbe7ff;
    cursor: pointer;
    user-select: none;
    transition: transform .06s ease, background .12s ease, border-color .12s ease;
}

.likert-dot:hover { transform: scale(1.03); }

/* Eticheta sub punct */
.likert-dot .likert-num{
    position: absolute;
    top: 52px;                /* sub cerc */
    left: 50%;
    transform: translateX(-50%);
    width: 74px;
    text-align: center;
    font-size: 12px;
    line-height: 1.1;
    color: #6b7280;
    font-weight: 600;
    white-space: normal;
    pointer-events: none;
}

/* spațiu pentru textul de jos */
.likert-scale{
    padding-top: 12px;
    padding-bottom: 58px;
}

.likert-scale::before{
    top: calc(12px + 22px);
}
.likert-legend{
    margin-top: 10px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.25;
    text-align: center;
}

.likert-dot .check {
    opacity: 0;
    transform: scale(.9);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
    line-height: 1;
    transition: opacity .12s ease, transform .12s ease;
}

/* selectat */
.likert-scale input[type="radio"]:checked + label.likert-dot {
    background: #0b63ff;
    border-color: #0b63ff;
}

.likert-scale input[type="radio"]:checked + label.likert-dot .check {
    opacity: 1;
    transform: scale(1);
}

/* Mobile switch: ascunde tabelul, arată "pills" */
@media (max-width: 640px) {
    .likert-table { display: none; }
    .likert-mobile { display: block; }

    /* ca să arate aerisit pe ecrane mici */
    .likert-dot { width: 46px; height: 46px; }
    .likert-scale { gap: 10px; }
}