.chapter-page-form { width: 100%; margin-top: 2rem; }
.chapter-page-form__notice { margin: 0 0 1.25rem; padding: 1rem 1.1rem; border-radius: var(--radius-card-md); }
.chapter-page-form__notice--success { background: rgba(129, 215, 180, 0.18); color: var(--core-primary); }
.chapter-page-form__notice--error { background: rgba(255, 78, 0, 0.08); color: #a23600; }
.chapter-page-form-success {
    width: 100%;
    max-width: 54rem;
    margin: 1rem auto 0;
    text-align: center;
}
.chapter-page-form-success .chapter-page-form__notice {
    display: inline-flex;
    justify-content: center;
    margin-bottom: 1rem;
}
.chapter-page-form-success__eyebrow {
    margin: 0;
    color: var(--orange);
    font-size: var(--text-label-size);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.chapter-page-form-success__title {
    margin: 0.85rem 0 0;
    color: var(--core-primary);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.05;
}
.chapter-page-form-success__code {
    display: inline-flex;
    align-items: center;
    min-height: 56px;
    margin-top: 1.1rem;
    padding: 0.85rem 1.1rem;
    border-radius: 1rem;
    background: var(--core-surface);
    color: var(--core-primary);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}
.chapter-page-form-success__qr {
    max-width: 19rem;
    margin: 1.15rem auto 0;
}
.chapter-page-form-success__qr-image {
    display: block;
    width: 100%;
    height: auto;
    padding: 0.8rem;
    border-radius: var(--radius-card-md);
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(30, 50, 139, 0.08);
}
.chapter-page-form-success__qr-note {
    margin: 0.85rem 0 0;
    color: var(--core-neutral);
    font-size: 0.98rem;
}
.chapter-page-form-success__copy {
    max-width: 46rem;
    margin: 1rem auto 0;
    color: var(--core-neutral);
}
.chapter-page-form-success__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem;
    margin-top: 1.2rem;
}
.chapter-page-form-success__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0.9rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.chapter-page-form-success__action--primary {
    background: var(--core-primary);
    color: #ffffff;
}
.chapter-page-form-success__action--secondary {
    background: #ffffff;
    border-color: rgba(30, 50, 139, 0.12);
    color: var(--core-primary);
}
.chapter-page-form-success__action--primary:hover {
    background: var(--orange);
    color: #ffffff;
}
.chapter-page-form-success__action--secondary:hover {
    background: var(--core-primary);
    border-color: transparent;
    color: #ffffff;
}
.chapter-page-form__form { width: 100%; }
.chapter-page-form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.15rem; }
.chapter-page-form__field { display: flex; flex-direction: column; gap: 0.45rem; }
.chapter-page-form__field--textarea,
.chapter-page-form__field--checkbox { grid-column: span 2; }
.chapter-page-form__field > label { color: var(--core-primary); font-weight: 600; }
.chapter-page-form__field > label span { color: var(--orange); }
.chapter-page-form__field input,
.chapter-page-form__field textarea,
.chapter-page-form__field select {
    width: 100%;
    min-height: 56px;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(30, 50, 139, 0.12);
    border-radius: 1.1rem;
    background: #ffffff;
    color: var(--core-primary);
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.chapter-page-form__field select,
.chapter-page-form__conditional-control select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 3.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 16 16%22 fill=%22none%22%3E%3Cpath d=%22M4 6.5l4 4 4-4%22 stroke=%22%231e328b%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.15rem center;
    background-size: 0.95rem 0.95rem;
}
.chapter-page-form__field input:focus,
.chapter-page-form__field textarea:focus,
.chapter-page-form__field select:focus {
    outline: none;
    border-color: rgba(30, 50, 139, 0.28);
    box-shadow: 0 0 0 4px rgba(129, 215, 180, 0.18);
}
.chapter-page-form__field textarea { min-height: 160px; resize: vertical; }
.chapter-page-form__other-control.is-hidden { display: none; }
.chapter-page-form__other-control { margin-top: 0.85rem; }
.chapter-page-form__conditional-control {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
    margin-top: 1rem;
}
.chapter-page-form__conditional-control.is-hidden { display: none; }
.chapter-page-form__conditional-control > label {
    color: var(--core-primary);
    font-weight: 600;
}
.chapter-page-form__conditional-control > label span { color: var(--orange); }
.chapter-page-form__other-input {
    width: 100%;
    min-height: 52px;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(30, 50, 139, 0.12);
    border-radius: 1rem;
    background: #ffffff;
    color: var(--core-primary);
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.chapter-page-form__other-input:focus {
    outline: none;
    border-color: rgba(30, 50, 139, 0.28);
    box-shadow: 0 0 0 4px rgba(129, 215, 180, 0.18);
}
.chapter-page-form__choices { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.chapter-page-form__choice {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--core-primary);
}
.chapter-page-form__choice input { width: auto; min-height: auto; padding: 0; border: 0; }
.chapter-page-form__field--radio .chapter-page-form__choices { gap: 0.85rem; }
.chapter-page-form__field--radio .chapter-page-form__choice {
    position: relative;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.chapter-page-form__field--radio .chapter-page-form__choice input[type="radio"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}
.chapter-page-form__field--radio .chapter-page-form__choice span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0.9rem 1.15rem;
    border: 1px solid rgba(30, 50, 139, 0.12);
    border-radius: 999px;
    background: #ffffff;
    color: var(--core-primary);
    font-weight: 600;
    line-height: 1;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.chapter-page-form__field--radio .chapter-page-form__choice input[type="radio"]:checked + span {
    border-color: transparent;
    background: var(--core-primary);
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(30, 50, 139, 0.16);
}
.chapter-page-form__field--radio .chapter-page-form__choice input[type="radio"]:focus + span,
.chapter-page-form__field--radio .chapter-page-form__choice input[type="radio"]:focus-visible + span {
    box-shadow: 0 0 0 4px rgba(129, 215, 180, 0.24);
}
.chapter-page-form__field--radio .chapter-page-form__choice:hover span {
    border-color: rgba(30, 50, 139, 0.22);
    transform: translateY(-1px);
}
.chapter-page-form__field--checkbox .chapter-page-form__choices {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
    margin-top: 0.25rem;
}
.chapter-page-form__field--checkbox .chapter-page-form__choice {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.95rem;
    width: 100%;
    margin: 0;
}
.chapter-page-form__field--checkbox .chapter-page-form__choice--other,
.chapter-page-form__field--radio .chapter-page-form__choice--other {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    width: auto;
    max-width: 100%;
    justify-self: start;
    margin: 0;
}
.chapter-page-form__choice-control {
    display: inline-flex;
    align-items: center;
}
.chapter-page-form__choice--other .chapter-page-form__other-input:disabled {
    opacity: 0.55;
}
.chapter-page-form__field--checkbox .chapter-page-form__choice input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.chapter-page-form__field--checkbox .chapter-page-form__choice span {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.95rem;
    color: #1f2430;
    font-weight: 500;
    line-height: 1.45;
}
.chapter-page-form__field--checkbox .chapter-page-form__choice span::before {
    content: "";
    display: inline-block;
    width: 1.55rem;
    height: 1.55rem;
    flex: 0 0 1.55rem;
    border: 2px solid rgba(30, 50, 139, 0.45);
    border-radius: 0.28rem;
    background: #ffffff;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.chapter-page-form__field--checkbox .chapter-page-form__choice input[type="checkbox"]:checked + span::before {
    border-color: var(--core-primary);
    background: var(--core-primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 16 16%22%3E%3Cpath d=%22M3.2 8.3l2.7 2.8L12.8 4.4%22 fill=%22none%22 stroke=%22%23ffffff%22 stroke-width=%222.2%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.95rem 0.95rem;
}
.chapter-page-form__field--checkbox .chapter-page-form__choice input[type="checkbox"]:focus + span::before,
.chapter-page-form__field--checkbox .chapter-page-form__choice input[type="checkbox"]:focus-visible + span::before {
    box-shadow: 0 0 0 4px rgba(129, 215, 180, 0.2);
}
.chapter-page-form__field--checkbox .chapter-page-form__choice--other .chapter-page-form__other-input,
.chapter-page-form__field--radio .chapter-page-form__choice--other .chapter-page-form__other-input {
    width: min(320px, 100%);
    flex: 0 0 320px;
    min-height: 56px;
    padding: 0.95rem 1rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(30, 50, 139, 0.12);
    background: #ffffff;
    color: var(--core-primary);
}
.chapter-page-form__field--checkbox .chapter-page-form__choice--other.is-active .chapter-page-form__other-input,
.chapter-page-form__field--radio .chapter-page-form__choice--other.is-active .chapter-page-form__other-input {
    border-color: rgba(30, 50, 139, 0.18);
}
.chapter-page-form__actions { margin-top: 1.5rem; }
.chapter-page-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 170px;
    min-height: 54px;
    padding: 0.9rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--core-primary);
    color: #ffffff;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    box-shadow: none;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}
.chapter-page-form__submit:hover,
.chapter-page-form__submit:focus {
    background: #2440b0;
    color: #ffffff;
    transform: translateY(-1px);
}

@media (max-width: 767px) {
    .chapter-page-form { margin-top: 1.5rem; }
    .chapter-page-form__grid { grid-template-columns: 1fr; }
    .chapter-page-form__field--textarea,
    .chapter-page-form__field--checkbox { grid-column: span 1; }
    .chapter-page-form-success__actions {
        flex-direction: column;
    }
    .chapter-page-form-success__action {
        width: 100%;
    }
    .chapter-page-form__field--checkbox .chapter-page-form__choice--other,
    .chapter-page-form__field--checkbox .chapter-page-form__choice--other,
    .chapter-page-form__field--radio .chapter-page-form__choice--other {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
        width: 100%;
    }
    .chapter-page-form__field--checkbox .chapter-page-form__choice--other .chapter-page-form__other-input,
    .chapter-page-form__field--radio .chapter-page-form__choice--other .chapter-page-form__other-input {
        width: 100%;
        flex: none;
    }
    .chapter-page-form__submit { width: 100%; }
}
