.register-hero {
    position: relative;
    overflow: hidden;
    background: #0f0c29; /* フォールバック背景 */
    color: #ffffff;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    margin-top: 0; /* ヘッダーとの隙間を完全に削除 */
}

/* 背景画像 */
.register-hero .hero-background-image {
    position: absolute;
    inset: 0;
    background-image: url('../media/images/start_bg.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* パララックス効果 */
    opacity: 1;
    z-index: 0;
    animation: heroImageFadeIn 1.5s ease-out;
}

/* グラデーションオーバーレイ（可読性の確保） */
.register-hero .hero-overlay {
    position: absolute;
    inset: 0;
    /* 左側（テキストエリア）を暗く、右側（フォームエリア）も読みやすく */
    background: linear-gradient(
        90deg,
        rgba(15, 12, 41, 0.85) 0%,
        rgba(15, 12, 41, 0.75) 40%,
        rgba(15, 12, 41, 0.70) 60%,
        rgba(15, 12, 41, 0.80) 100%
    ),
    /* 上部と下部を少し暗くして、中央の宇宙の球体の明るさを抑える */
    linear-gradient(
        180deg,
        rgba(15, 12, 41, 0.3) 0%,
        transparent 20%,
        transparent 80%,
        rgba(15, 12, 41, 0.4) 100%
    );
    z-index: 1;
    pointer-events: none;
}

.register-hero .hero-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 65%);
    opacity: 0.6;
    pointer-events: none;
    z-index: 2;
}

/* コンテンツを前面に */
.register-hero .container {
    position: relative;
    z-index: 3;
    padding-top: 4rem; /* 上部の余白をコンテナ内に移動 */
    padding-bottom: 6rem; /* 下部の余白をコンテナ内に移動 */
}

/* 背景画像のフェードインアニメーション */
@keyframes heroImageFadeIn {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-transform: uppercase;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: heroBadgeFadeIn 0.8s ease-out 0.1s both;
}

.hero-title {
    font-family: "Unbounded", "Noto Sans JP", sans-serif;
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5),
                 0 4px 40px rgba(0, 0, 0, 0.3);
    animation: heroTitleFadeIn 1s ease-out 0.3s both;
}

.hero-lead {
    font-size: 1.05rem;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.85);
}

.hero-highlights {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
    display: grid;
    gap: 0.75rem;
}

.hero-highlights li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.9rem;
    padding: 0.75rem 1rem;
}

.register-card {
    position: relative;
    border-radius: 1.5rem;
    background: rgba(14, 12, 40, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    animation: registerCardFadeIn 1s ease-out 0.5s both;
}

.register-heading {
    font-family: "Unbounded", "Noto Sans JP", sans-serif;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.register-sub {
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 1.5rem;
}

.register-form .form-control {
    background-color: rgba(255, 255, 255, 0.07);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.register-form .form-control:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 0 0.25rem rgba(251, 191, 36, 0.25);
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.register-form label {
    color: rgba(255, 255, 255, 0.7);
}

.consent-grid {
    margin-top: 0.5rem;
    display: grid;
    gap: 0.75rem;
}

.consent-grid .form-check {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0.9rem;
    padding: 0.85rem 1rem;
}

.consent-grid .form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.75rem;
}

.consent-grid .form-check-label {
    color: rgba(255, 255, 255, 0.82);
    font-weight: 500;
}

.form-note {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 991.98px) {
    .register-card {
        padding: 2rem;
    }

    .hero-title {
        margin-top: 1rem;
    }
}

/* アニメーション定義 */
@keyframes heroBadgeFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroTitleFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes registerCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* レスポンシブ対応 */
@media (max-width: 991.98px) {
    .register-hero {
        min-height: auto;
    }
    
    .register-hero .container {
        padding-top: 3rem;
        padding-bottom: 4rem;
    }
    
    .register-hero .hero-background-image {
        background-attachment: scroll; /* モバイルではパララックス無効 */
    }
    
    .register-hero .hero-overlay {
        /* モバイルでは全体的に少し暗く */
        background: linear-gradient(
            90deg,
            rgba(15, 12, 41, 0.90) 0%,
            rgba(15, 12, 41, 0.85) 100%
        );
    }
}

@media (max-width: 575.98px) {
    .register-hero .container {
        padding-top: 2rem;
        padding-bottom: 3rem;
    }

    .register-card {
        padding: 1.75rem;
    }
    
    .hero-title {
        text-shadow: 0 2px 15px rgba(0, 0, 0, 0.6);
    }
}

/* ============================================
   魂の扉が開くアニメーション
   ============================================ */

.soul-door-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    overflow: hidden;
    pointer-events: none;
    background: transparent;
}

.soul-door-background {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(15, 12, 41, 0.98) 0%, #0a0818 100%);
    opacity: 0;
    transition: opacity 0.8s ease-out, opacity 1s ease-out;
}

.soul-door-overlay.active .soul-door-background {
    opacity: 1;
}

.soul-door-left,
.soul-door-right {
    position: absolute;
    top: 0;
    width: 50.5%;
    height: 100%;
    background: linear-gradient(135deg, #0f0c29 0%, #1a1538 50%, #0f0c29 100%);
    box-shadow: inset -20px 0 60px rgba(0, 0, 0, 0.8),
                inset 0 0 100px rgba(116, 132, 255, 0.15);
    transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1),
                opacity 1s ease-out;
    will-change: transform, opacity;
    opacity: 1;
}

.soul-door-left {
    left: 0;
    transform: translateX(0);
    border-right: 2px solid rgba(255, 189, 105, 0.3);
}

.soul-door-right {
    right: 0;
    transform: translateX(0);
    border-left: 2px solid rgba(255, 189, 105, 0.3);
    right: -0.5%;
}

/* テキストフェードアウト時は扉のスタイルを一切変更しない（文字だけフェードアウト） */
/* 扉のスタイルは通常時と同じまま維持されるため、特別なスタイル定義は不要 */

.soul-door-overlay.active .soul-door-left {
    transform: translateX(-100%);
}

.soul-door-overlay.active .soul-door-right {
    transform: translateX(100%);
}

/* 中央の境界線を隠すオーバーレイ（マスクは使用せず、扉の影で対応） */
/* 
.soul-door-center-mask {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #0f0c29 0%, #1a1538 50%, #0f0c29 100%);
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    pointer-events: none;
}

テキストフェードアウト時に中央のマスクを表示して境界線を隠す
.soul-door-overlay.text-fade-out .soul-door-center-mask {
    opacity: 1;
}
*/

.soul-door-center-light {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 0;
    height: 0;
    background: radial-gradient(circle, 
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 189, 105, 0.8) 20%,
        rgba(116, 132, 255, 0.6) 40%,
        transparent 70%);
    border-radius: 50%;
    transition: transform 1.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 1.5s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 1s ease-out;
    will-change: transform, width, height, opacity;
    animation: pulse-glow 2s ease-in-out infinite;
    opacity: 1;
}

.soul-door-overlay.active .soul-door-center-light {
    width: 120vw;
    height: 120vw;
    transform: translate(-50%, -50%) scale(1);
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.8;
        filter: blur(40px);
    }
    50% {
        opacity: 1;
        filter: blur(60px);
    }
}

.soul-door-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1s ease-in 0.3s, opacity 1s ease-out;
}

.soul-door-overlay.active .soul-door-particles {
    opacity: 1;
}

.soul-door-particles::before,
.soul-door-particles::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 
        0 0 20px rgba(255, 189, 105, 0.8),
        0 0 40px rgba(116, 132, 255, 0.6),
        100px 200px 0 2px rgba(255, 255, 255, 0.7),
        200px 300px 0 1.5px rgba(255, 189, 105, 0.6),
        300px 100px 0 2px rgba(116, 132, 255, 0.7),
        -150px 250px 0 1.5px rgba(255, 255, 255, 0.6),
        -250px 150px 0 2px rgba(255, 189, 105, 0.7),
        400px 400px 0 1.5px rgba(116, 132, 255, 0.6),
        -350px 350px 0 2px rgba(255, 255, 255, 0.7),
        500px 200px 0 1.5px rgba(255, 189, 105, 0.6);
    animation: float-particles 8s ease-in-out infinite;
}

.soul-door-particles::after {
    animation-delay: -4s;
    box-shadow: 
        0 0 20px rgba(116, 132, 255, 0.8),
        0 0 40px rgba(255, 189, 105, 0.6),
        -100px 300px 0 2px rgba(255, 255, 255, 0.7),
        -200px 200px 0 1.5px rgba(116, 132, 255, 0.6),
        -300px 400px 0 2px rgba(255, 189, 105, 0.7),
        150px 150px 0 1.5px rgba(255, 255, 255, 0.6),
        250px 350px 0 2px rgba(116, 132, 255, 0.7),
        -400px 100px 0 1.5px rgba(255, 189, 105, 0.6),
        350px 450px 0 2px rgba(255, 255, 255, 0.7),
        -500px 300px 0 1.5px rgba(116, 132, 255, 0.6);
}

@keyframes float-particles {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.6;
    }
    25% {
        transform: translate(30px, -50px) rotate(90deg);
        opacity: 1;
    }
    50% {
        transform: translate(-20px, -80px) rotate(180deg);
        opacity: 0.8;
    }
    75% {
        transform: translate(40px, -30px) rotate(270deg);
        opacity: 1;
    }
}

.soul-door-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.8s ease-in 0.5s;
}

.soul-door-overlay.active .soul-door-text {
    opacity: 1;
}

/* テキストのフェードアウト（1.5秒かけて消える、背景は残す） */
.soul-door-overlay.text-fade-out .soul-door-text {
    opacity: 0;
    transition: opacity 1.5s ease-out;
}

.soul-door-overlay.text-fade-out .soul-door-title,
.soul-door-overlay.text-fade-out .soul-door-subtitle {
    opacity: 0;
    transition: opacity 1.5s ease-out;
}

/* テキストフェードアウト時は背景・扉・光・パーティクルを一切変更しない（文字だけフェードアウト） */
/* 
 * これらの要素は.activeで既に適切な状態になっているため、
 * .text-fade-out時にはスタイルを変更しない（継続表示）
 * transition: none を設定することで、状態が固定される
 */
.soul-door-overlay.text-fade-out .soul-door-background,
.soul-door-overlay.text-fade-out .soul-door-left,
.soul-door-overlay.text-fade-out .soul-door-right,
.soul-door-overlay.text-fade-out .soul-door-center-light,
.soul-door-overlay.text-fade-out .soul-door-particles {
    /* 状態を固定（.activeで設定された状態を維持） */
    transition: none;
    /* opacity, transform, width, height などは.activeで設定された値が継続 */
}

/* 全体のフェードアウト（真っ白になる前） */
.soul-door-overlay.fade-out {
    transition: opacity 0.5s ease-out;
}

.soul-door-overlay.fade-out .soul-door-background,
.soul-door-overlay.fade-out .soul-door-left,
.soul-door-overlay.fade-out .soul-door-right,
.soul-door-overlay.fade-out .soul-door-center-light,
.soul-door-overlay.fade-out .soul-door-particles {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

/* 真っ白画面表示時はすべての要素を隠す */
.soul-door-overlay.white-screen .soul-door-background,
.soul-door-overlay.white-screen .soul-door-left,
.soul-door-overlay.white-screen .soul-door-right,
.soul-door-overlay.white-screen .soul-door-center-light,
.soul-door-overlay.white-screen .soul-door-particles,
.soul-door-overlay.white-screen .soul-door-text {
    opacity: 0 !important;
    visibility: hidden;
}

/* 真っ白な画面 */
.soul-door-white-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    opacity: 0;
    z-index: 999999;
    transition: opacity 0.5s ease-in;
    pointer-events: none;
}

.soul-door-overlay.white-screen .soul-door-white-screen {
    opacity: 1;
    background: #ffffff;
}

/* 真っ白画面表示時は背景のページを完全に隠す */
.soul-door-overlay.white-screen {
    background: #ffffff;
    z-index: 999999;
}

.soul-door-text-inner {
    position: relative;
}

.soul-door-title {
    font-family: "Unbounded", "Noto Sans JP", sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    color: #ffffff;
    text-shadow: 
        0 0 20px rgba(255, 189, 105, 0.8),
        0 0 40px rgba(116, 132, 255, 0.6),
        0 0 60px rgba(255, 255, 255, 0.4);
    margin-bottom: 1rem;
    letter-spacing: 0.1em;
    animation: text-glow 2s ease-in-out infinite alternate;
}

.soul-door-subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    animation: text-fade 2s ease-in-out infinite alternate;
}

@keyframes text-glow {
    0% {
        text-shadow: 
            0 0 20px rgba(255, 189, 105, 0.8),
            0 0 40px rgba(116, 132, 255, 0.6),
            0 0 60px rgba(255, 255, 255, 0.4);
    }
    100% {
        text-shadow: 
            0 0 30px rgba(255, 189, 105, 1),
            0 0 60px rgba(116, 132, 255, 0.8),
            0 0 90px rgba(255, 255, 255, 0.6);
    }
}

@keyframes text-fade {
    0% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

/* 動的パーティクルアニメーション */
@keyframes particle-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
    25% {
        transform: translate(20px, -30px) scale(1.2);
        opacity: 1;
    }
    50% {
        transform: translate(-15px, -50px) scale(0.8);
        opacity: 0.8;
    }
    75% {
        transform: translate(25px, -20px) scale(1.1);
        opacity: 1;
    }
}

/* モバイル最適化 */
@media (max-width: 767.98px) {
    .soul-door-title {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }
    
    .soul-door-subtitle {
        font-size: clamp(0.9rem, 3vw, 1.2rem);
    }
    
    .soul-door-overlay.active .soul-door-center-light {
        width: 150vw;
        height: 150vw;
    }
}
