/* =========================================================
   Survey Form UI - Clean Generic Baseline v5
   Guardian / Student / Infant / Admin
   No legacy compatibility layer
   ========================================================= */

:root {
    --survey-section-title-size: 1.15rem;
    --survey-card-title-size: 1.15rem;
    --survey-panel-title-size: 1.15rem;
    --survey-label-size: 1rem;
    --survey-help-size: 0.85rem;

    --survey-label-gap: 3px;
    --survey-help-gap: 4px;
    --survey-option-gap: 6px;
    --survey-field-gap: 22px;
    --survey-panel-gap: 28px;
    --survey-card-gap: 22px;
    --survey-section-gap: 28px;
    --survey-panel-wide-gap: 36px;

    --survey-section-padding: 22px;
    --survey-card-padding: 20px;
    --survey-nested-indent: 18px;

    --survey-border: #d5d9dd;
    --survey-border-light: #e1e4e7;
    --survey-section-bg: #e9eef3;
    --survey-card-bg: #f0f3f6;
    --survey-panel-title-color: #5f6670;
    --survey-help-color: #777;
    --survey-required-color: #b00020;
}

/* ---------- CF7 / theme normalization ---------- */

.survey-section,
.survey-card {
    box-sizing: border-box;
}

.survey-section p:empty,
.survey-card p:empty {
    display: none;
}

.survey-field > p,
.survey-options > p,
.survey-panel > p,
.survey-card-content > p {
    margin: 0;
    padding: 0;
}

.survey-field label > br,
.survey-options > br,
.survey-card label > br,
.survey-section label > br {
    display: none;
}

/* ---------- Top-level section ---------- */

.survey-section {
    width: 100%;
    margin: 0 0 var(--survey-section-gap);
    overflow: hidden;
    border: 1px solid var(--survey-border);
    border-radius: 7px;
    background: #fff;
}

.survey-section-toggle {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 54px;
    margin: 0;
    padding: 14px 52px 14px 18px;
    border: 0;
    border-radius: 0;
    background: var(--survey-section-bg);
    color: #222;
    text-align: left;
    cursor: pointer;
}

.survey-section > .survey-section-toggle:hover,
.survey-section > .survey-section-toggle:focus {
    background: #dfe7ee;
    color: #222;
}

.survey-section-title {
    display: block;
    width: 100%;
    font-size: var(--survey-section-title-size);
    font-weight: 700;
    line-height: 1.4;
}

.survey-section-content {
    padding: var(--survey-section-padding);
}

.survey-section-content[hidden] {
    display: none;
}

/* CF7 automatic formatting can leave paragraph/BR wrappers between block elements. */
.survey-section-content > p,
.survey-card-content > p {
    margin: 0;
    padding: 0;
}

.survey-section-content > p > br:only-child,
.survey-card-content > p > br:only-child {
    display: none;
}

/* ---------- Reusable person card ---------- */

.survey-card {
    width: 100%;
    margin: 0 0 var(--survey-card-gap);
    overflow: hidden;
    border: 1px solid var(--survey-border);
    border-radius: 6px;
    background: #fff;
}

.survey-card-toggle {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 11px 48px 11px 16px;
    border: 0;
    border-radius: 0;
    background: var(--survey-card-bg);
    color: #222;
    text-align: left;
    cursor: pointer;
}

.survey-card > .survey-card-toggle:hover,
.survey-card > .survey-card-toggle:focus {
    background: #e6ebef;
    color: #222;
}

.survey-card-title {
    display: block;
    width: 100%;
    font-size: var(--survey-card-title-size);
    font-weight: 700;
    line-height: 1.4;
}

.survey-card-content {
    padding: var(--survey-card-padding);
}

.survey-card-content[hidden] {
    display: none;
}

/* ---------- Shared +/- icon ---------- */

.survey-toggle-icon {
    position: absolute;
    top: 50%;
    right: 19px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
}

.survey-toggle-icon::before,
.survey-toggle-icon::after {
    position: absolute;
    top: 50%;
    left: 0;
    width: 18px;
    height: 2px;
    background: currentColor;
    content: "";
    transform: translateY(-50%);
}

.survey-toggle-icon::after {
    transform: translateY(-50%) rotate(90deg);
    transition: transform .2s ease;
}

.survey-section-toggle[aria-expanded="true"] .survey-toggle-icon::after,
.survey-card-toggle[aria-expanded="true"] .survey-toggle-icon::after {
    transform: translateY(-50%) rotate(0deg);
}

/* ---------- Generic grids ---------- */

.survey-grid {
    display: grid;
    align-items: start;
}

.survey-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--survey-panel-gap);
}

.survey-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--survey-panel-gap);
}

.survey-panel {
    min-width: 0;
}

.survey-panel-wide {
    margin-top: var(--survey-panel-wide-gap);
}

.survey-panel-title {
    margin: 0 0 14px;
    padding: 0 0 6px;
    border-bottom: 1px solid var(--survey-border);
    color: var(--survey-panel-title-color);
    font-size: var(--survey-panel-title-size);
    font-weight: 700;
    line-height: 1.4;
}

/*
 * School bus stop panel
 *
 * 住所ブロックとの区切りを少し広げ、
 * タイトルから最初の入力項目までの
 * 余白を通常のPanelと同程度に整える。
 */
.survey-school-bus-stop-panel {
    margin-top: 30px;
}

/* ---------- Generic field rhythm ---------- */

.survey-field {
    min-width: 0;
    margin: 0 0 var(--survey-field-gap);
    padding: 0;
}

.survey-field:last-child {
    margin-bottom: 0;
}

.survey-field label {
    display: block;
    margin: 0;
    padding: 0;
}

.survey-label {
    display: block;
    margin: 0 0 var(--survey-label-gap);
    padding: 0;
    font-size: var(--survey-label-size);
    font-weight: 600;
    line-height: 1.3;
}

.survey-label em {
    color: var(--survey-required-color);
    font-style: normal;
}

.survey-help {
    display: block;
    margin: 0 0 var(--survey-help-gap);
    padding: 0;
    color: var(--survey-help-color);
    font-size: var(--survey-help-size);
    font-style: italic;
    line-height: 1.3;
}

/* ---------- Standard controls ---------- */

.survey-section .wpcf7-form-control-wrap,
.survey-card .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.survey-section input[type="text"],
.survey-section input[type="email"],
.survey-section input[type="tel"],
.survey-section input[type="date"],
.survey-section input[type="number"],
.survey-section select,
.survey-section textarea,
.survey-card input[type="text"],
.survey-card input[type="email"],
.survey-card input[type="tel"],
.survey-card input[type="date"],
.survey-card input[type="number"],
.survey-card select,
.survey-card textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    margin: 0;
    box-sizing: border-box;
}

/*
 * Select controls
 * Astra/theme側のline-heightによる文字切れを防止する。
 */
.survey-section select,
.survey-card select {
    height: 48px;
    min-height: 48px;
    padding-top: 0;
    padding-bottom: 0;
    line-height: normal;
}

.survey-section textarea,
.survey-card textarea {
    min-height: 110px;
    resize: vertical;
}

/* ---------- Radio / checkbox ---------- */

.survey-options {
    display: block;
}

.survey-options > p > .survey-label,
.survey-options > .survey-label {
    display: block;
    margin: 0 0 var(--survey-option-gap) !important;
}

.survey-options > p > .survey-label + br,
.survey-options > .survey-label + br {
    display: none !important;
}

.survey-options > p,
.survey-options > .wpcf7-form-control-wrap,
.survey-options > span.wpcf7-form-control {
    margin: 0 !important;
    padding: 0 !important;
}

.survey-options > p + p,
.survey-options > .survey-label + p,
.survey-options > .survey-label + .wpcf7-form-control-wrap,
.survey-options > .survey-label + span.wpcf7-form-control {
    margin-top: 0 !important;
}

.survey-section .survey-options .wpcf7-form-control-wrap,
.survey-section .survey-options span.wpcf7-form-control,
.survey-section .survey-options .wpcf7-radio,
.survey-section .survey-options .wpcf7-checkbox,
.survey-card .survey-options .wpcf7-form-control-wrap,
.survey-card .survey-options span.wpcf7-form-control,
.survey-card .survey-options .wpcf7-radio,
.survey-card .survey-options .wpcf7-checkbox,
.survey-final-check-row .wpcf7-form-control-wrap,
.survey-final-check-row span.wpcf7-form-control {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0;
    box-shadow: none !important;
    background: transparent !important;
}

.survey-options .wpcf7-radio,
.survey-options .wpcf7-checkbox {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px 18px;
}

.survey-options .wpcf7-list-item {
    display: inline-block;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.survey-options .wpcf7-list-item label {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    width: auto;
    margin: 0;
    padding: 0;
}

.survey-options input[type="radio"],
.survey-options input[type="checkbox"] {
    flex: 0 0 auto;
    margin: 0;
}

/* ---------- Counts ---------- */

.survey-count {
    margin: 0 0 24px;
    padding: 0 0 18px;
    border-bottom: 1px solid var(--survey-border);
}

/* ---------- Nested conditional area ---------- */

.survey-nested {
    margin: 4px 0 var(--survey-field-gap) var(--survey-nested-indent);
    padding: 14px 0 0 18px;
    border-left: 3px solid var(--survey-border);
}

.survey-nested-small {
    margin-top: 4px;
    padding-top: 12px;
}

/* Student arrival-month block is intentionally more compact. */
.survey-arrival-nested {
    margin-top: -10px;
    padding-top: 7px;
}

.survey-arrival-nested .survey-field {
    margin-bottom: 0;
}

.survey-guardian2-option {
    margin-top: 0;
    margin-bottom: 18px;
}

/* ---------- Student structural layout ---------- */

.survey-student-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr)
        minmax(0, 1.35fr);
    gap: 26px;
    align-items: start;
}

.survey-name-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.survey-student-block {
    margin: 0;
}

.survey-school-grid {
    display: grid;
    grid-template-columns:
        minmax(150px, 1fr)
        minmax(120px, .78fr)
        minmax(120px, .78fr);
    gap: 12px;
    align-items: start;
}

.survey-school-cell {
    min-width: 0;
}

.survey-school-cell > p {
    margin: 0;
    padding: 0;
}

.survey-school-cell > br {
    display: none;
}

.survey-school-cell .survey-field {
    margin-top: 0;
    padding-top: 0;
}

.survey-school-cell select,
.survey-school-cell .survey-class-select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.survey-local-school-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px;
    gap: 12px;
    align-items: start;
}

.survey-local-school-cell {
    min-width: 0;
}

.survey-local-school-cell .survey-field {
    margin-bottom: 18px;
}

.survey-local-school-cell label {
    display: grid;
    grid-template-rows: auto 2.8em 44px;
    align-content: start;
}

.survey-local-school-cell .survey-help {
    height: 2.8em;
    min-height: 2.8em;
    margin: 0;
    overflow: visible;
    line-height: 1.4;
}

.survey-local-school-cell .wpcf7-form-control-wrap {
    align-self: end;
}

.survey-local-school-grade .survey-help-placeholder {
    visibility: hidden;
}

.survey-local-school-grade select {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
    padding-left: 10px;
    padding-right: 28px;
}

.survey-health-notes {
    height: 78px;
    min-height: 78px;
}

.survey-inactive-field {
    margin-top: 0;
    padding-top: 14px;
    border-top: 1px solid var(--survey-border-light);
}

/* ---------- Infant cards ---------- */

.survey-infant-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.5fr)
        minmax(150px, .9fr)
        minmax(160px, .9fr);
    gap: 14px;
    align-items: start;
}

/* ---------- Admin ---------- */

.survey-admin-grid {
    display: grid;
    grid-template-columns: minmax(220px, .75fr) minmax(0, 1.25fr);
    gap: 26px 34px;
    align-items: start;
}

.survey-admin-item {
    margin: 0 0 var(--survey-field-gap);
}

.survey-admin-item > p,
.survey-admin-item label {
    margin: 0;
    padding: 0;
}

.survey-admin-item label br {
    display: none;
}

.survey-admin-notes textarea {
    width: 100%;
    min-height: 180px;
    resize: vertical;
}

/* ---------- Year selector ---------- */

.survey-year-selector-area {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    width: 100%;
    margin: 0 0 24px;
    padding: 14px 18px;
    border: 1px solid #d8dde3;
    border-radius: 6px;
    background: #f7f8fa;
    box-sizing: border-box;
}

.survey-year-selector-area label {
    margin: 0;
    font-weight: 600;
}

.survey-year-select {
    width: auto;
    min-width: 145px;
    height: 48px;
    min-height: 48px;
    margin: 0;
    padding: 0 34px 0 12px;
    border: 1px solid #98a2ad;
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: 48px;
    box-sizing: border-box;
}

.survey-year-message {
    flex-basis: 100%;
    margin: 2px 0 0;
    color: #555;
    font-size: .9rem;
    line-height: 1.4;
}

.survey-year-copy-area {
    flex-basis: 100%;
    margin-top: 6px;
}

.survey-copy-year-button {
    display: inline-block;
    width: auto;
    min-width: 260px;
    margin: 6px 0 0;
    padding: 10px 20px;
    border: 1px solid #666;
    border-radius: 4px;
    background: #f2f2f2;
    color: #222;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
}

.survey-copy-year-button:disabled {
    opacity: .45;
    color: #222;
    cursor: not-allowed;
}

.survey-year-copy-status,
.survey-year-copy-unavailable {
    margin-top: 7px;
    font-size: .9rem;
    line-height: 1.4;
}

/* ---------- User final / actions ---------- */

.survey-user-final-area {
    width: calc((100% - 36px) / 3);
    margin: 28px 0 18px auto;
}

.survey-final-check-row {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-sizing: border-box;
}

.survey-user-action-area {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    width: 100%;
    margin: 0 0 24px;
}

.survey-user-action-item {
    min-width: 0;
    text-align: center;
}

.survey-user-action-area .survey-action-button,
.survey-user-action-area input.survey-action-button,
.survey-admin-save-button,
.survey-discard-changes-button {
    height: 52px;
    min-height: 52px;
    padding: 0 18px;
    border: 1px solid #758291;
    border-radius: 6px;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    vertical-align: middle;
    cursor: pointer;
    box-sizing: border-box;
}

button.survey-action-button,
button.survey-admin-save-button,
button.survey-discard-changes-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.2 !important;
}

.survey-user-action-area button.survey-action-button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
}

.survey-user-action-area input.survey-action-button {
    text-align: center;
    line-height: 50px;
    padding-top: 0;
    padding-bottom: 0;
}

.survey-discard-changes-button {
    background: #fff;
    color: #303840;
}

.survey-draft-save-button {
    background: #e9eef3;
    color: #263442;
}

.survey-submit-button {
    background: #2f6fa5;
    border-color: #2f6fa5;
    color: #fff;
}

.survey-admin-save-button {
    background: #dbe5f7;
    color: #17243a;
}

.survey-action-message,
.survey-admin-save-status,
.survey-discard-changes-status {
    margin: 8px 0 0;
    font-size: .88rem;
    line-height: 1.4;
}

.survey-submit-disabled {
    min-height: 48px;
    padding: 9px 12px;
    border: 1px dashed #9da5ad;
    border-radius: 6px;
    background: #f5f5f5;
    color: #666;
}

/* ---------- Read-only / validation ---------- */

.survey-read-only-year input:disabled,
.survey-read-only-year select:disabled,
.survey-read-only-year textarea:disabled {
    opacity: 1;
    cursor: default;
    background-color: #f5f6f7;
}

.survey-validation-deferred .wpcf7-not-valid-tip {
    display: none;
}

.survey-validation-deferred .wpcf7-not-valid {
    border: 1px solid var(--survey-border);
    box-shadow: none;
}

/* ---------- Responsive ---------- */

@media screen and (max-width: 1100px) {
    .survey-student-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .survey-student-school-panel {
        grid-column: 1 / -1;
    }
}

@media screen and (max-width: 900px) {
    .survey-grid-2,
    .survey-grid-3 {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .survey-nested {
        margin-left: 8px;
        padding-left: 12px;
    }

    .survey-infant-grid,
    .survey-admin-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 700px) {

    .survey-user-final-area {
        width: 100%;
        margin-left: 0;
    }
    .survey-student-grid,
    .survey-name-grid,
    .survey-school-grid,
    .survey-local-school-grid {
        grid-template-columns: 1fr;
    }

    .survey-local-school-grade select {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .survey-local-school-cell .survey-help {
        min-height: 0;
    }

    .survey-local-school-grade .survey-help-placeholder {
        display: none;
    }

    .survey-card-content {
        padding: 15px;
    }

    .survey-user-action-area {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

@media screen and (max-width: 600px) {
    :root {
        --survey-section-padding: 16px;
        --survey-panel-gap: 18px;
    }

    .survey-section-toggle {
        padding-left: 15px;
    }
}

/* =========================================================
   Student Card Header / Reorder Controls
   ========================================================= */

.survey-card-header {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.survey-card-header .survey-card-toggle {
    flex: 1 1 auto;
    min-width: 0;
}

.survey-student-reorder {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    background: #eef2f5;
}

.survey-student-reorder-button {
    width: auto;
    min-width: 0;
    padding: 5px 10px;
    margin: 0;

    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;

    color: #333333;
    background: transparent;
    border: 1px solid #aeb8c2;
    border-radius: 4px;

    cursor: pointer;
}

.survey-student-reorder-button:hover {
    color: #333333;
    background: #ffffff;
    border-color: #8f9aa5;
}

.survey-student-reorder-button:disabled {
    cursor: default;
    opacity: 0.5;
}

/* =========================================================
   Student Status Options
   ========================================================= */

.survey-student-status-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.survey-student-status-option {
    padding: 16px 10px 6px 18px;
    background: #f8f9fa;
    border: 1px solid #d9dee3;
    border-radius: 6px;
}

.survey-student-status-label {
    display: block;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.survey-student-status-label .wpcf7-list-item {
    margin: 0;
}

.survey-student-status-description {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #555555;
}

/* Narrow screens */
@media (max-width: 700px) {

    .survey-student-status-options {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   Withdrawn Students
   ========================================================= */

.survey-withdrawn-student-list {
    margin-top: 16px;
}

.survey-withdrawn-student {
    position: relative;
    margin-bottom: 12px;
    padding: 10px 170px 10px 18px;

    background: #f8f9fa;
    border: 1px solid #d9dee3;
    border-radius: 6px;
}

.survey-withdrawn-student-name {
    margin-bottom: 4px;

    font-size: 16px;
    font-weight: 600;
}

.survey-withdrawn-student-detail {
    font-size: 14px;
    line-height: 1.5;
}

.survey-withdrawn-restore-button {
    position: absolute;
    top: 50%;
    right: 18px;
    transform: translateY(-50%);

    width: auto;
    min-width: 110px;
    padding: 7px 12px;
    margin: 0;

    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;

    color: #333333;
    background: #ffffff;
    border: 1px solid #aeb8c2;
    border-radius: 4px;

    cursor: pointer;
}

.survey-withdrawn-restore-button:hover {
    color: #333333;
    background: #ffffff;
    border-color: #8f9aa5;
}

.survey-withdrawn-restore-button:disabled {
    cursor: default;
    opacity: 0.5;
}


/* Narrow screens */

@media (max-width: 700px) {

    .survey-withdrawn-student {
        padding: 14px 18px;
    }

    .survey-withdrawn-restore-button {
        position: static;
        transform: none;
        margin-top: 10px;
    }
}

/* =========================================================
   Withdrawn Students - Divider
   ========================================================= */

#survey-withdrawn-students {
    border-top: 1px solid var(--survey-border);
    padding-top: 18px;
}

/* =========================================================
   Privacy and Security Notice
   ========================================================= */

.survey-privacy-notice-wrap {
    margin: 20px 0;
}

.survey-privacy-notice {
    margin: 0;
    background: #ffffff;
    border: 1px solid #d9dee3;
    border-radius: 6px;
    overflow: hidden;
}


/* Header */

.survey-privacy-notice-summary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 10px 18px;

    background: #e8edf2;

    cursor: pointer;
    list-style: none;
}

.survey-privacy-notice-summary::-webkit-details-marker {
    display: none;
}

.survey-privacy-notice-summary::marker {
    display: none;
    content: "";
}


/* Header text */

.survey-privacy-notice-heading {
    display: flex;
    flex-direction: column;
    gap: 3px;

    width: 100%;
    padding-right: 40px;
}

.survey-privacy-notice-title {
    display: block;

    margin: 0 0 2px 0;
    padding: 0;

    font-weight: 600;
    line-height: 1.35;
}

.survey-privacy-notice-intro {
    display: flex;
    flex-direction: column;
    gap: 0;

    margin: 0;
    padding: 0;

    font-size: 13px;
    font-weight: 400;
    line-height: 1.35;
}


/* + / - */

.survey-privacy-notice-icon {
    position: absolute;
    right: 20px;
    top: 50%;

    width: 16px;
    height: 16px;

    transform: translateY(-50%);
}

.survey-privacy-notice-icon::before,
.survey-privacy-notice-icon::after {
    content: "";

    position: absolute;
    top: 50%;
    left: 0;

    width: 16px;
    height: 2px;

    background: currentColor;

    transform: translateY(-50%);
}

.survey-privacy-notice-icon::after {
    transform:
        translateY(-50%)
        rotate(90deg);
}

.survey-privacy-notice[open]
.survey-privacy-notice-icon::after {
    display: none;
}


/* Notice body */

.survey-privacy-notice-content {
    padding: 22px 24px 18px;
}

.survey-privacy-notice-content p {
    margin: 0 0 16px;
    line-height: 1.75;
}

.survey-privacy-notice-japanese {
    padding-bottom: 8px;
}

.survey-privacy-notice-english {
    margin-top: 8px;
    padding-top: 20px;

    border-top: 1px solid #d9dee3;
}

.survey-privacy-contact {
    font-weight: 600;
}


/* Mobile */

@media (max-width: 700px) {

    .survey-privacy-notice-summary {
        padding: 9px 16px;
    }

    .survey-privacy-notice-heading {
        padding-right: 32px;
    }

    .survey-privacy-notice-icon {
        right: 16px;
    }

    .survey-privacy-notice-content {
        padding: 18px 16px 14px;
    }
}


/* =====================================================
   Privacy Notice - anchor scroll position
   ===================================================== */

#survey-privacy-notice {
    scroll-margin-top: 180px;
}

/* =====================================================
   Privacy Notice - prevent CF7 automatic br spacing
   ===================================================== */

.survey-privacy-notice-summary > br,
.survey-privacy-notice-heading > br,
.survey-privacy-notice-title > br,
.survey-privacy-notice-intro > br {
    display: none !important;
}

/* =====================================================
   Privacy Notice - compact closed header
   ===================================================== */

.survey-privacy-notice-summary {
    min-height: 0 !important;
    height: auto !important;
    padding: 10px 18px !important;
}

.survey-privacy-notice-summary .survey-privacy-notice-heading {
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.survey-privacy-notice-summary
.survey-privacy-notice-title,
.survey-privacy-notice-summary
.survey-privacy-notice-intro {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* =========================================================
   General user final confirmation
   ========================================================= */

.survey-user-final-area {
    width: 100%;
    margin: 28px 0 18px;
    padding: 0;
}


/* =====================================================
   Final Acknowledgment
   ===================================================== */

/* 日本語・英語をまとめる外枠 */
.survey-final-acknowledgment-box {
    width: 100%;
    margin: 0;
    padding: 12px 16px;

    border: 1px solid #d8dde3;
    border-radius: 6px;
    background: #f7f8fa;

    box-sizing: border-box;
}


/* チェックボックス + 日本語 */
.survey-final-check-row {
    display: flex;
    align-items: flex-start;
    width: 100%;
    margin: 0;
    padding: 0;

    border: none;
    background: transparent;

    box-sizing: border-box;
}


/* 英文 */
.survey-final-acknowledgment-en {
    margin-top: 8px;
    padding-left: 34px;
    line-height: 1.6;
}


/* CF7 checkbox の余白を除去 */
.survey-final-check-row .wpcf7-form-control-wrap,
.survey-final-check-row .wpcf7-checkbox {
    display: block;
    margin: 0 !important;
    padding: 0 !important;
}

.survey-final-check-row .wpcf7-list-item {
    margin: 0 !important;
    padding: 0 !important;
}

.survey-final-check-row .wpcf7-list-item label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 !important;
    padding: 0 !important;

    font-weight: 600;
}


/* =====================================================
   Final Acknowledgment - checkbox label
   ===================================================== */

/*
 * CF7内部値「確認完了」は維持し、
 * 画面上の文字だけ非表示
 */
#final-check .wpcf7-list-item-label {
    display: none;
}


/* 日本語本文 */
.survey-final-acknowledgment-ja {
    flex: 1;
    margin-left: 12px;
    line-height: 1.6;
    font-weight: 600;
}

/* =========================================================
   General user action buttons
   ========================================================= */

.survey-user-action-area .survey-action-button,
.survey-user-action-area input.survey-action-button {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 48px;

    margin: 0 !important;
    padding: 11px 16px !important;

    border: 1px solid #758291 !important;
    border-radius: 6px !important;

    font: inherit !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    text-align: center !important;

    cursor: pointer;
    box-sizing: border-box;
}


/* 提出 */

.survey-user-action-area .survey-submit-button {
    background: #2f6fa5 !important;
    border-color: #2f6fa5 !important;
    color: #ffffff !important;
}

.survey-user-action-area .survey-submit-button:hover,
.survey-user-action-area .survey-submit-button:focus {
    background: #245a88 !important;
    border-color: #245a88 !important;
}

/* =========================================================
   PJS CF7 validation display
   ========================================================= */

/*
 * 「確認完了」前は
 * CF7の必須エラーメッセージを表示しない。
 */
.wpcf7 form.survey-validation-deferred
.wpcf7-not-valid-tip {
    display: none !important;
}

/*
 * 「確認完了」前は
 * CF7が内部的に wpcf7-not-valid を付けても
 * 赤枠を表示しない。
 */
.wpcf7 form.survey-validation-deferred
.wpcf7-not-valid {
    border-color: #d5d9dd !important;
    box-shadow: none !important;
}


/*
 * 「確認完了」後に表示される
 * Validation Error メッセージ。
 */
.wpcf7 form:not(.survey-validation-deferred)
.wpcf7-not-valid-tip {
    margin-top: 4px;
    font-size: 0.85rem;
}


/*
 * 「確認完了」後だけ
 * Validation Error の入力欄を赤枠にする。
 */
.wpcf7 form:not(.survey-validation-deferred)
.wpcf7-not-valid {
    border-color: #b00020 !important;
}

/* =====================================================
   Final submit - blocked by validation
   ===================================================== */

/*
 * Validation Error がある間は
 * Conditional Fields の提出グループ全体を隠す
 */
.survey-submit-blocked-by-validation
[data-id="group-submit"] {
    display: none !important;
}

/*
 * Validation Error がある間は
 * 「提出不可」グループを表示する
 */
.survey-submit-blocked-by-validation
[data-id="group-dummy"] {
    display: block !important;
    margin: 0 !important;
}