/* ================================================
   Event Survey — Frontend styles
   ================================================ */

.evt-survey-wrap {
    max-width: 660px;
    margin: 2.5rem auto;
    font-family: inherit;
}

/* Reset theme margins inside the card */
.evt-survey-card p,
.evt-survey-card h2,
.evt-survey-card h3 {
    margin-block-start: 0 !important;
    margin-block-end: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* ---- Card container ---- */
.evt-survey-card {
    background: #fff;
    border-radius: 12px;
    border: 1.5px solid #c8d8c0;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    overflow: hidden;
}

/* ---- Header band ---- */
.evt-survey-header {
    background: #1b3a2a;
    color: #fff;
    padding: 1.25rem 1.75rem 1rem;
    text-align: center;
}

.evt-survey-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 .3rem;
    color: #fff;
    letter-spacing: .02em;
}

.evt-survey-header p {
    margin: 0;
    font-size: .875rem;
    color: rgba(255,255,255,.70);
    line-height: 1.4;
}

/* ---- Form body ---- */
.evt-survey-form {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ---- Each question block ---- */
.evt-survey-field {
    padding: .75rem 0;
    margin: 0;
    border-bottom: 1px solid #f0ede8;
}

.evt-survey-field:last-of-type {
    border-bottom: none;
}

.evt-survey-label {
    font-weight: 600;
    font-size: .95rem;
    color: #1b3a2a;
    margin: 0 0 .5rem !important;
    line-height: 1.4;
    display: block;
}

.evt-required {
    color: #c0392b;
    margin-left: 2px;
}

/* ---- Stars ---- */
.evt-stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: .15rem;
    margin-top: .25rem;
}

.evt-stars input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
    clip: rect(0,0,0,0);
    overflow: hidden;
}

.evt-star-label {
    cursor: pointer;
    font-size: 2.6rem;
    line-height: 1;
    color: #ddd;
    transition: color .12s, transform .1s;
}

.evt-star-label:hover {
    transform: scale(1.15);
}

/* Hover: light up this star and all to the right */
.evt-stars .evt-star-label:hover .evt-star,
.evt-stars .evt-star-label:hover ~ .evt-star-label .evt-star {
    color: #c8a84b;
}

/* Selected state managed by JS class */
.evt-stars.has-value .evt-star-label .evt-star {
    color: #ddd;
}

.evt-stars.has-value .evt-star-label.selected .evt-star,
.evt-stars.has-value .evt-star-label.selected ~ .evt-star-label .evt-star {
    color: #c8a84b;
}

/* ---- Checkboxes & Radios — custom styled ---- */
.evt-checkboxes,
.evt-radios {
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.evt-check-label,
.evt-radio-label {
    display: flex;
    align-items: center;
    gap: .6rem;
    cursor: pointer;
    padding: .4rem .6rem;
    border-radius: 6px;
    border: 1.5px solid transparent;
    transition: background .12s, border-color .12s;
    user-select: none;
}

.evt-check-label:hover,
.evt-radio-label:hover {
    background: #f4f7f4;
    border-color: #c8d8c8;
}

/* Hide native input, replace with custom indicator */
.evt-check-label input[type="checkbox"],
.evt-radio-label input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
    border: 2px solid #bbb;
    background: #fff;
    cursor: pointer;
    transition: border-color .12s, background .12s;
    position: relative;
}

.evt-check-label input[type="checkbox"] {
    border-radius: 4px;
}

.evt-radio-label input[type="radio"] {
    border-radius: 50%;
}

.evt-check-label input[type="checkbox"]:checked,
.evt-radio-label input[type="radio"]:checked {
    border-color: #1b3a2a;
    background: #1b3a2a;
}

/* Checkmark for checkbox */
.evt-check-label input[type="checkbox"]:checked::after {
    content: '';
    display: block;
    width: .35rem;
    height: .6rem;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translate(1px, -1px);
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -.45rem;
    margin-left: -.2rem;
}

/* Dot for radio */
.evt-radio-label input[type="radio"]:checked::after {
    content: '';
    display: block;
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Highlight checked row */
.evt-check-label:has(input:checked),
.evt-radio-label:has(input:checked) {
    background: #f0f6f1;
    border-color: #1b3a2a;
}

/* ---- Text inputs ---- */
.evt-text-input,
.evt-textarea {
    width: 100%;
    padding: .7rem .9rem;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: .95rem;
    font-family: inherit;
    box-sizing: border-box;
    margin-top: .5rem;
    resize: vertical;
    transition: border-color .15s, box-shadow .15s;
    background: #fafafa;
    color: #222;
}

.evt-text-input:focus,
.evt-textarea:focus {
    outline: none;
    border-color: #1b3a2a;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(27,58,42,.1);
}

/* ---- Submit area ---- */
.evt-submit-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
}

.evt-btn-submit {
    background: #1b3a2a;
    color: #fff;
    border: none;
    padding: .85rem 2.25rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: .03em;
    transition: background .15s, transform .1s;
}

.evt-btn-submit:hover {
    background: #0f2318;
    transform: translateY(-1px);
}

.evt-btn-submit:active {
    transform: translateY(0);
}

.evt-btn-submit:disabled {
    background: #aaa;
    cursor: not-allowed;
    transform: none;
}

/* ---- Spinner — hidden by default, shown by JS class ---- */
.evt-spinner {
    display: none !important;
    width: 1.3rem;
    height: 1.3rem;
    border: 3px solid #ddd;
    border-top-color: #1b3a2a;
    border-radius: 50%;
    animation: evt-spin .7s linear infinite;
    flex-shrink: 0;
}

.evt-spinner.active {
    display: inline-block !important;
}

@keyframes evt-spin { to { transform: rotate(360deg); } }

/* ---- Errors ---- */
.evt-error {
    color: #c0392b;
    font-size: .875rem;
    margin: .4rem 0 0;
}

.evt-field-error[style*="display:none"],
.evt-field-error[hidden] { display: none !important; }

/* ---- Already done / Thank-you ---- */
.evt-survey-done,
.evt-survey-thankyou {
    padding: 3rem 2rem;
    text-align: center;
}

.evt-survey-emoji {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 1rem;
    line-height: 1;
}

.evt-survey-thankyou h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1b3a2a;
    margin-bottom: .6rem;
}

.evt-survey-done p,
.evt-survey-thankyou p {
    color: #666;
    font-size: .95rem;
    line-height: 1.6;
}

.evt-survey-closed {
    font-style: italic;
    color: #666;
    text-align: center;
    padding: 1.5rem;
    background: #f9f9f7;
    border-radius: 8px;
}

/* ---- Mobile ---- */
@media (max-width: 520px) {
    .evt-survey-header { padding: 1.5rem 1.25rem; }
    .evt-survey-form   { padding: 0 1.25rem 1.5rem; }
    .evt-survey-done,
    .evt-survey-thankyou { padding: 2rem 1.25rem; }
    .evt-star-label    { font-size: 2.1rem; }
    .evt-btn-submit    { width: 100%; justify-content: center; }
}
