:root {
    --register-bg: radial-gradient(circle at 18% -8%, rgba(115, 155, 255, 0.35), transparent 55%),
        radial-gradient(circle at 86% 10%, rgba(26, 209, 185, 0.32), transparent 50%),
        linear-gradient(165deg, rgba(6, 14, 45, 0.98), rgba(2, 7, 24, 0.98));
    --register-card-bg: linear-gradient(155deg, rgba(14, 26, 64, 0.96), rgba(8, 20, 52, 0.94));
    --register-section-bg: linear-gradient(145deg, rgba(18, 36, 86, 0.65), rgba(9, 22, 60, 0.68));
    --register-border: rgba(115, 168, 255, 0.38);
    --register-shadow: 0 32px 64px rgba(4, 11, 32, 0.55);
    --register-shadow-soft: 0 18px 36px rgba(3, 8, 26, 0.4);
}

.register-body,
.confirm-body {
    margin: 0;
    min-height: 100vh;
    background: var(--register-bg), #030a21;
    color: var(--color-text, #f9fdff);
    font-family: "Noto Sans JP", "Segoe UI", "Helvetica Neue", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    align-items: stretch;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

.register-body::before,
.register-body::after,
.confirm-body::before,
.confirm-body::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.register-body::before,
.confirm-body::before {
    background: radial-gradient(circle at 14% 84%, rgba(40, 110, 255, 0.22), transparent 58%);
}

.register-body::after,
.confirm-body::after {
    background: radial-gradient(circle at 88% 82%, rgba(31, 196, 169, 0.18), transparent 62%);
}

.register-shell,
.confirm-shell {
    width: min(1120px, 94vw);
    margin: clamp(40px, 6vw, 72px) auto;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(24px, 4vw, 40px);
    position: relative;
    z-index: 1;
}

.register-hero,
.confirm-hero {
    grid-column: span 5;
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2.8vw, 28px);
    align-self: start;
}

.register-badge,
.confirm-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(98, 164, 255, 0.18);
    border: 1px solid rgba(162, 204, 255, 0.32);
    color: rgba(215, 230, 255, 0.95);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    width: fit-content;
    box-shadow: var(--register-shadow-soft);
}

.register-title,
.confirm-title {
    margin: 0;
    font-size: clamp(2rem, 4.2vw, 3rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.register-copy,
.confirm-copy {
    margin: 0;
    color: rgba(215, 227, 255, 0.78);
    font-size: clamp(1rem, 2vw, 1.08rem);
    line-height: 1.75;
}

.register-points,
.confirm-points {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: rgba(210, 226, 255, 0.82);
}

.register-points li,
.confirm-points li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.register-card,
.confirm-card {
    grid-column: span 7;
    padding: clamp(28px, 4.5vw, 42px);
    border-radius: 30px;
    background: var(--register-card-bg);
    border: 1px solid var(--register-border);
    box-shadow: var(--register-shadow);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    gap: clamp(22px, 4vw, 28px);
    --form-control-radius: 14px;
    --form-control-border: rgba(146, 188, 255, 0.35);
    --form-control-bg: rgba(8, 18, 52, 0.7);
    --form-control-color: #f4f8ff;
    --form-control-placeholder: rgba(186, 206, 255, 0.55);
    --form-control-focus-border: rgba(176, 220, 255, 0.72);
    --form-control-focus-bg: rgba(10, 22, 58, 0.78);
    --form-control-focus-color: #f4f8ff;
    --form-control-focus-shadow: 0 0 0 4px rgba(86, 146, 255, 0.25);
    --form-field-gap: 6px;
}

.register-card__header,
.confirm-card__header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.register-card__title,
.confirm-card__title {
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.register-card__caption,
.confirm-card__caption {
    margin: 0;
   color: rgba(209, 223, 255, 0.7);
   font-size: 0.95rem;
   line-height: 1.6;
}

.register-card .form-field label,
.confirm-card .form-field label {
    color: rgba(214, 228, 255, 0.88);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 800;
    color: rgba(147, 199, 255, 0.9);
    text-decoration: none;
    width: fit-content;
    transition: color 0.2s ease, transform 0.2s ease;
}

.back-link::before {
    content: "←";
}

.back-link:hover,
.back-link:focus-visible {
    color: rgba(26, 209, 185, 0.95);
    transform: translateX(-2px);
}

.register-form {
    display: flex;
    flex-direction: column;
    gap: clamp(22px, 4vw, 30px);
}

.form-section {
    padding: clamp(18px, 3.5vw, 26px);
    border-radius: 22px;
    background: var(--register-section-bg);
    border: 1px solid rgba(145, 192, 255, 0.32);
    box-shadow: inset 0 0 0 1px rgba(132, 180, 255, 0.12);
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 3vw, 22px);
}

.form-section__header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-section__title {
    margin: 0;
    font-size: clamp(1.1rem, 2.4vw, 1.45rem);
    font-weight: 600;
    color: rgba(225, 235, 255, 0.95);
}

.form-section__description {
    margin: 0;
    color: rgba(204, 219, 255, 0.72);
    font-size: 0.9rem;
    line-height: 1.6;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(14px, 2.8vw, 22px);
}

.form-grid--pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid--single {
    grid-template-columns: 1fr;
}

.zip-input {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.zip-input input {
    flex: 0 0 140px;
    max-width: 140px;
    margin-bottom: 0;
}

.zip-input button {
    white-space: nowrap;
    padding: 10px 20px;
    font-size: 0.9rem;
    height: 48px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: auto;
    margin-top: 0;
}

.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    top: 35%;
    width: 80px;
    right: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(160, 204, 255, 0.28);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(225, 235, 255, 0.88);
    font-size: 0.75rem;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.12);
}

.inline-error {
    margin: -6px 0 0;
    font-size: 0.82rem;
    color: #ff96a6;
    display: none;
}

.inline-error[aria-hidden="false"] {
    display: block;
}

.form-field select {
    height: 48px;
}

.gender-group {
    display: inline-flex;
    gap: 12px;
    flex-wrap: wrap;
}

.gender-group input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.gender-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45%;
    padding: 10px 20px;
    border-radius: 999px;
    background: rgba(62, 100, 205, 0.4);
    border: 1px solid rgba(143, 188, 255, 0.35);
    color: rgba(220, 230, 255, 0.9);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.gender-group input:checked + .gender-pill {
    background: rgba(255, 224, 88, 0.9);
    color: rgba(32, 32, 42, 0.95);
    border-color: rgba(255, 224, 88, 0.9);
    transform: translateY(-1px);
}

.custom-select {
    position: relative;
}

.custom-select select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 42px;
}

.custom-select::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 12px;
    height: 12px;
    transform: translateY(-50%);
    pointer-events: none;
    opacity: 0.6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d2e0ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
}

.child-section {
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 3vw, 22px);
}

.child-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.child-header h3 {
    margin: 0;
    font-size: 1.05rem;
    color: rgba(224, 236, 255, 0.92);
}

.add-child-btn,
.remove-child-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 18px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.add-child-btn.primary {
    background: linear-gradient(135deg, rgba(116, 176, 255, 0.95), rgba(61, 112, 255, 0.88));
    color: #050c23;
    box-shadow: 0 16px 32px rgba(44, 112, 255, 0.35);
}

.add-child-btn.primary:hover,
.add-child-btn.primary:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 20px 34px rgba(44, 112, 255, 0.45);
}

.remove-child-btn {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(225, 235, 255, 0.86);
    border: 1px solid rgba(180, 208, 255, 0.3);
    margin-top: 0px;
}

.register-card .btn-ghost,
.confirm-card .btn-ghost {
    width: auto;
    margin-top: 0;
}

.remove-child-btn:hover,
.remove-child-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 18px 28px rgba(6, 18, 52, 0.35);
}

.remove-child-btn {
    width: 150px;
    padding: 6px 12px;
    font-size: 0.85rem;
    background: rgba(255, 112, 134, 0.16);
    border-color: rgba(255, 112, 134, 0.42);
    color: rgba(255, 210, 220, 0.92);
}

.add-child-btn {
    width: fit-content;
    align-self: flex-start;
    margin-top: 6px;
}

.children-wrapper {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 3vw, 22px);
}

.zip-input span {
    top: 20%;
    color: rgba(214, 228, 255, 0.76);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 14px;
    font-size: 1.1rem;
    font-weight: 600;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: flex-end;
    margin-top: 8px;
}

.info-card {
    grid-column: 1 / -1;
    padding: clamp(22px, 4vw, 32px);
    border-radius: 26px;
    background: rgba(10, 26, 62, 0.72);
    border: 1px solid rgba(120, 170, 255, 0.28);
    box-shadow: var(--register-shadow-soft);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: clamp(18px, 3vw, 28px);
}

.info-card__section > h3 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: rgba(214, 228, 255, 0.92);
}

.info-card__section p {
    margin: 0;
    color: rgba(198, 214, 255, 0.78);
    line-height: 1.7;
    font-size: 0.92rem;
}

.info-card__section a {
    color: rgba(147, 199, 255, 0.92);
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.info-card__section a:hover,
.info-card__section a:focus-visible {
    color: rgba(26, 209, 185, 0.95);
}

.confirmation-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.confirmation-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(20, 42, 96, 0.58);
    border: 1px solid rgba(136, 182, 255, 0.25);
}

.confirmation-label {
    font-weight: 600;
    color: rgba(255, 210, 112, 0.92);
    min-width: 120px;
}

.confirmation-value {
    flex: 1;
    color: rgba(230, 236, 255, 0.95);
}

.children-confirmation {
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 3vw, 22px);
}

.child-confirm-card {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(12, 28, 70, 0.68);
    border: 1px solid rgba(138, 188, 255, 0.28);
    display: flex;
    flex-direction: column;
    gap: 10px;
}



.confirm-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    width: 100%;
}

.confirm-actions > .btn,
.confirm-actions > form {
    display: flex;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
}

.confirm-actions > .btn {
    justify-content: center;
}

.confirm-actions > form {
    margin: 0;
}

.confirm-actions > form button {
    flex: 1 1 auto;
}

.contact-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-relation,
.contact-phone {
    width: 100%;
}

.relationship-select {
    width: 100%;
}

.phone-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
}

.phone-input-group .contact-phone-input {
    min-width: 110px;
    max-width: 160px;
    width: auto;
    text-align: center;
    flex: 1 1 0;
}

.phone-input-group span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 14px;
    color: rgba(214, 228, 255, 0.78);
}

.child-birth-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.child-birth-row {
    display: flex;
    gap: 10px;
}

.child-birth-row .custom-select {
    flex: 1 1 0;
}

.child-gender-field {
    margin-top: -4px;
}

.child-school-other-field {
    display: none;
}

.child-school-other-field.is-visible {
    display: block;
    margin-top: 4px;
}

@media (max-width: 1024px) {
    .register-shell,
    .confirm-shell {
        grid-template-columns: repeat(6, 1fr);
    }

    .register-hero,
    .confirm-hero {
        grid-column: 1 / -1;
        text-align: center;
        align-items: center;
    }

    .register-card,
    .confirm-card {
        grid-column: 1 / -1;
    }

    .info-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .register-shell,
    .confirm-shell {
        margin: clamp(28px, 8vw, 48px) auto;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .zip-input {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .zip-input button {
        display: none;
    }

    .zip-input input {
        flex: 1 1 0;
        max-width: none;
        min-width: 0;
    }

    .contact-row {
        gap: 12px;
    }

    .phone-input-group {
        gap: 8px;
    }

    .phone-input-group .contact-phone-input {
        flex: 1 1 0;
        min-width: 0;
    }

    .child-birth-row {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    .add-child-btn,
    .form-actions {
        width: 100%;
    }

    .confirm-actions {
        width: 100%;
        gap: 12px;
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
    }

    .confirm-actions > .btn,
    .confirm-actions > form {
        flex: 1 1 48%;
        display: flex;
    }

    .confirm-actions > .btn {
        justify-content: center;
    }

    .confirm-actions > form button {
        flex: 1 1 auto;
    }

    .form-actions {
        justify-content: center;
    }

    .btn,
    .add-child-btn {
        width: 100%;
    }

    .remove-child-btn {
        width: auto;
        align-self: flex-end;
    }

    .form-grid.form-grid--pair {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
    }

    .form-grid.form-grid--pair .form-field {
        min-width: 0;
    }

    .zip-input input {
        flex: 0 0 100px;
        max-width: 100px;
    }

    .zip-input button {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}
