/* Zavier theme-owned stylesheet; visual tokens are finalized by css/theme.css. */
/* Source: app/Modules/Survei/Views/detail.php */

.survey-detail-page {
    --survey-blue: #1f5fae;
    --survey-blue-dark: #16477f;
    --survey-blue-soft: #eaf2fb;
    --survey-blue-pale: #f5f9fd;
    --survey-border: #d8e3ef;
    --survey-text: #172b43;
    --survey-muted: #64748b;
    min-height: 100vh;
    padding: 104px 20px 76px;
    color: var(--survey-text);
    background: #f4f7fa;
}

.survey-detail-shell {
    width: min(1080px, 100%);
    margin: 0 auto;
}

.survey-detail-header,
.survey-intro-card,
.survey-question-panel,
.survey-progress-card,
.survey-detail-empty {
    border: 1px solid var(--survey-border);
    background: #fff;
}

.survey-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding: 18px 20px;
    border-radius: 10px;
}

.survey-detail-back,
.survey-detail-heading-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
}

.survey-detail-back {
    width: 42px;
    height: 42px;
    color: var(--survey-blue-dark);
    border: 1px solid #c8dbef;
    border-radius: 10px;
    background: var(--survey-blue-soft);
    transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.survey-detail-back:hover,
.survey-detail-back:focus-visible {
    color: #fff;
    border-color: var(--survey-blue);
    background: var(--survey-blue);
}

.survey-detail-heading-icon {
    width: 46px;
    height: 46px;
    color: var(--survey-blue);
    border-radius: 10px;
    background: var(--survey-blue-soft);
}

.survey-detail-header svg {
    width: 21px;
    height: 21px;
}

.survey-detail-heading {
    min-width: 0;
    flex: 1;
}

.survey-detail-heading h1,
.survey-detail-heading p,
.survey-intro-main h2,
.survey-intro-main p,
.survey-question-panel-heading h2,
.survey-question-panel-heading p,
.survey-progress-heading h2,
.survey-progress-heading p,
.survey-progress-note p,
.survey-detail-empty h2,
.survey-detail-empty p {
    margin: 0;
}

.survey-detail-heading h1 {
    color: var(--survey-text);
    font-size: clamp(1.3rem, 2.3vw, 1.7rem);
    font-weight: 700;
    line-height: 1.25;
}

.survey-detail-heading p {
    margin-top: 3px;
    color: var(--survey-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.survey-intro-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.7fr);
    overflow: hidden;
    margin-bottom: 16px;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(22, 71, 127, 0.04);
}

.survey-intro-main {
    padding: 25px 26px;
}

.survey-active-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 6px 9px;
    color: #216247;
    border: 1px solid #c4e2d1;
    border-radius: 999px;
    background: #edf8f2;
    font-size: 0.72rem;
    font-weight: 700;
}

.survey-active-label svg {
    width: 14px;
    height: 14px;
}

.survey-intro-main h2 {
    max-width: 650px;
    color: #142b44;
    font-size: clamp(1.45rem, 3vw, 2.1rem);
    font-weight: 750;
    line-height: 1.24;
    letter-spacing: -0.02em;
}

.survey-intro-main p {
    max-width: 690px;
    margin-top: 10px;
    color: var(--survey-muted);
    font-size: 0.88rem;
    line-height: 1.65;
}

.survey-intro-meta {
    display: grid;
    align-content: center;
    gap: 1px;
    padding: 17px 22px;
    border-left: 1px solid var(--survey-border);
    background: var(--survey-blue-pale);
}

.survey-intro-meta > span {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 9px 0;
}

.survey-intro-meta > span > svg {
    width: 18px;
    height: 18px;
    color: var(--survey-blue);
}

.survey-intro-meta > span > span {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.survey-intro-meta small {
    color: var(--survey-muted);
    font-size: 0.69rem;
    line-height: 1.3;
}

.survey-intro-meta strong {
    margin-top: 2px;
    color: #294158;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.4;
}

.survey-detail-alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 16px;
    padding: 14px 16px;
    color: #8a3030;
    border: 1px solid #eccaca;
    border-radius: 10px;
    background: #fff5f5;
}

.survey-detail-alert > svg {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.survey-detail-alert div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.survey-detail-alert strong {
    font-size: 0.83rem;
}

.survey-detail-alert span {
    color: #9d4949;
    font-size: 0.78rem;
    line-height: 1.45;
}

.survey-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: start;
    gap: 16px;
}

.survey-question-panel {
    min-width: 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(22, 71, 127, 0.04);
}

.survey-question-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid #e6edf5;
}

.survey-question-panel-heading h2 {
    color: var(--survey-text);
    font-size: 1rem;
    font-weight: 700;
}

.survey-question-panel-heading p {
    margin-top: 3px;
    color: var(--survey-muted);
    font-size: 0.74rem;
}

.survey-required-note,
.survey-required-mark {
    color: #c43e3e;
    font-weight: 800;
}

.survey-question-panel-heading > span {
    display: inline-flex;
    min-width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    color: var(--survey-blue-dark);
    border-radius: 10px;
    background: var(--survey-blue-soft);
    font-size: 0.8rem;
    font-weight: 700;
}

.survey-question-list {
    display: grid;
}

.survey-question-card {
    min-width: 0;
    margin: 0;
    padding: 22px;
    border: 0;
    border-bottom: 1px solid #e8eef5;
}

.survey-question-card:last-child {
    border-bottom: 0;
}

.survey-question-card legend {
    display: flex;
    width: 100%;
    align-items: flex-start;
    gap: 11px;
    margin: 0;
    padding: 0;
}

.survey-question-number {
    display: inline-flex;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    color: var(--survey-blue-dark);
    border-radius: 9px;
    background: var(--survey-blue-soft);
    font-size: 0.78rem;
    font-weight: 750;
}

.survey-question-title {
    padding-top: 4px;
    color: #233b53;
    font-size: 0.91rem;
    font-weight: 700;
    line-height: 1.5;
}

.survey-required-mark {
    margin-left: 3px;
}

.survey-answer-hint {
    display: block;
    margin: 7px 0 12px 41px;
    color: #75869a;
    font-size: 0.72rem;
    line-height: 1.45;
}

.survey-choice-list {
    display: grid;
    gap: 8px;
    margin-left: 41px;
}

.survey-choice-list.is-horizontal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.survey-choice {
    position: relative;
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 45px;
    margin: 0;
    padding: 9px 12px;
    color: #42566c;
    border: 1px solid var(--survey-border);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.survey-choice:hover {
    border-color: #adc8e5;
    background: var(--survey-blue-pale);
}

.survey-choice:has(input:checked) {
    color: var(--survey-blue-dark);
    border-color: #87add6;
    background: var(--survey-blue-soft);
}

.survey-choice:has(input:focus-visible) {
    outline: 3px solid rgba(31, 95, 174, 0.2);
    outline-offset: 2px;
}

.survey-choice input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.survey-choice-control {
    display: inline-flex;
    width: 21px;
    height: 21px;
    align-items: center;
    justify-content: center;
    color: transparent;
    border: 1.5px solid #9cafc2;
    border-radius: 6px;
    background: #fff;
    transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.survey-choice input[type="radio"] + .survey-choice-control {
    border-radius: 50%;
}

.survey-choice-control svg {
    width: 14px;
    height: 14px;
    stroke-width: 3;
}

.survey-choice input:checked + .survey-choice-control {
    color: #fff;
    border-color: var(--survey-blue);
    background: var(--survey-blue);
}

.survey-choice input[type="radio"]:checked + .survey-choice-control svg {
    width: 9px;
    height: 9px;
    fill: currentColor;
    stroke: currentColor;
}

.survey-choice-label {
    font-size: 0.81rem;
    font-weight: 550;
    line-height: 1.45;
}

.survey-text-answer {
    display: block;
}

.survey-text-answer textarea {
    display: block;
    width: calc(100% - 41px);
    min-height: 112px;
    margin-left: 41px;
    padding: 12px 14px;
    color: #33475d;
    border: 1px solid var(--survey-border);
    border-radius: 10px;
    outline: 0;
    background: #fff;
    font: inherit;
    font-size: 0.82rem;
    line-height: 1.55;
    resize: vertical;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.survey-text-answer textarea::placeholder {
    color: #98a6b6;
}

.survey-text-answer textarea:focus {
    border-color: #7fa9d5;
    box-shadow: 0 0 0 3px rgba(31, 95, 174, 0.12);
}

.survey-submit-area {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 18px 22px;
    border-top: 1px solid #e6edf5;
    background: #fafcfe;
}

.survey-submit-area a,
.survey-submit-area button {
    display: inline-flex;
    min-height: 43px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.survey-submit-area a {
    color: #53677d;
    border: 1px solid var(--survey-border);
    background: #fff;
    text-decoration: none;
}

.survey-submit-area button {
    color: #fff;
    border: 1px solid var(--survey-blue);
    background: var(--survey-blue);
    transition: border-color 0.18s ease, background-color 0.18s ease;
}

.survey-submit-area a:hover,
.survey-submit-area a:focus-visible {
    color: var(--survey-blue-dark);
    border-color: #adc8e5;
}

.survey-submit-area button:hover,
.survey-submit-area button:focus-visible {
    border-color: var(--survey-blue-dark);
    background: var(--survey-blue-dark);
}

.survey-submit-area button:disabled {
    cursor: wait;
    opacity: 0.72;
}

.survey-submit-area svg {
    width: 17px;
    height: 17px;
}

.survey-submit-area button.is-loading svg {
    animation: survey-send-pulse 0.8s ease-in-out infinite alternate;
}

.survey-progress-card {
    position: sticky;
    top: 92px;
    padding: 20px;
    border-radius: 10px;
}

.survey-progress-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.survey-progress-heading > span {
    display: inline-flex;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    color: var(--survey-blue);
    border-radius: 10px;
    background: var(--survey-blue-soft);
}

.survey-progress-heading svg {
    width: 18px;
    height: 18px;
}

.survey-progress-heading h2 {
    color: var(--survey-text);
    font-size: 0.9rem;
    font-weight: 700;
}

.survey-progress-heading p {
    margin-top: 2px;
    color: var(--survey-muted);
    font-size: 0.7rem;
}

.survey-progress-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 20px;
}

.survey-progress-value strong {
    color: var(--survey-blue-dark);
    font-size: 1.7rem;
    font-weight: 750;
    line-height: 1;
}

.survey-progress-value span {
    color: var(--survey-muted);
    font-size: 0.72rem;
}

.survey-progress-track {
    overflow: hidden;
    height: 7px;
    margin-top: 11px;
    border-radius: 999px;
    background: #e6edf5;
}

.survey-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--survey-blue);
    transition: width 0.2s ease;
}

.survey-progress-percent {
    margin-top: 7px;
    color: var(--survey-blue-dark);
    font-size: 0.72rem;
    font-weight: 700;
    text-align: right;
}

.survey-progress-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 18px;
    padding: 11px;
    color: #52677d;
    border-radius: 10px;
    background: var(--survey-blue-pale);
}

.survey-progress-note svg {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    color: var(--survey-blue);
}

.survey-progress-note p {
    font-size: 0.69rem;
    line-height: 1.5;
}

.survey-detail-empty {
    display: flex;
    min-height: 330px;
    padding: 38px 24px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    text-align: center;
}

.survey-detail-empty > span {
    display: inline-flex;
    width: 62px;
    height: 62px;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: var(--survey-blue);
    border-radius: 10px;
    background: var(--survey-blue-soft);
}

.survey-detail-empty > span svg {
    width: 29px;
    height: 29px;
}

.survey-detail-empty h2 {
    color: var(--survey-text);
    font-size: 1.05rem;
    font-weight: 700;
}

.survey-detail-empty p {
    max-width: 460px;
    margin-top: 7px;
    color: var(--survey-muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.survey-detail-empty a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 7px;
    margin-top: 18px;
    padding: 8px 14px;
    color: #fff;
    border-radius: 10px;
    background: var(--survey-blue);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
}

.survey-detail-empty a svg {
    width: 16px;
    height: 16px;
}

@keyframes survey-send-pulse {
    from { transform: translateX(0); }
    to { transform: translateX(3px); }
}

@media (max-width: 899.98px) {
    .survey-intro-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .survey-intro-meta {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        border-top: 1px solid var(--survey-border);
        border-left: 0;
    }

    .survey-detail-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .survey-progress-card {
        position: static;
        grid-row: 1;
    }
}

@media (max-width: 767.98px) {
    .survey-detail-page {
        padding: 76px 12px calc(94px + env(safe-area-inset-bottom));
    }

    .survey-detail-header {
        gap: 10px;
        padding: 13px;
        border-radius: 10px;
    }

    .survey-detail-heading-icon {
        display: none;
    }

    .survey-detail-heading p {
        font-size: 0.75rem;
    }

    .survey-intro-card,
    .survey-question-panel,
    .survey-detail-empty {
        border-radius: 10px;
        box-shadow: none;
    }

    .survey-intro-main {
        padding: 20px 17px;
    }

    .survey-intro-main h2 {
        font-size: 1.42rem;
    }

    .survey-intro-meta {
        grid-template-columns: minmax(0, 1fr);
        padding: 8px 17px;
    }

    .survey-intro-meta > span {
        grid-template-columns: 28px minmax(0, 1fr);
        padding: 8px 0;
    }

    .survey-progress-card {
        padding: 17px;
        border-radius: 10px;
    }

    .survey-question-panel-heading,
    .survey-submit-area {
        padding: 15px 16px;
    }

    .survey-question-card {
        padding: 19px 16px;
    }

    .survey-question-card legend {
        gap: 9px;
    }

    .survey-question-number {
        flex-basis: 28px;
        width: 28px;
        height: 28px;
    }

    .survey-question-title {
        padding-top: 3px;
        font-size: 0.86rem;
    }

    .survey-answer-hint,
    .survey-choice-list,
    .survey-text-answer textarea {
        margin-left: 37px;
    }

    .survey-choice-list.is-horizontal {
        grid-template-columns: minmax(0, 1fr);
    }

    .survey-text-answer textarea {
        width: calc(100% - 37px);
    }

    .survey-submit-area {
        display: grid;
        grid-template-columns: 0.8fr 1.2fr;
    }

    .survey-submit-area a,
    .survey-submit-area button {
        width: 100%;
        padding-right: 10px;
        padding-left: 10px;
    }
}

@media (max-width: 399.98px) {
    .survey-submit-area {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .survey-detail-page *,
    .survey-detail-page *::before,
    .survey-detail-page *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
