/* ========================================
   リセット & ベース設定
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f5f5f7;
    color: #1d1d1f;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   ヘッダー画像
   ======================================== */
.header-image {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
}

.header-image picture {
    width: 100%;
    display: flex;
    justify-content: center;
}

.header-image img {
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ========================================
   フォームコンテナ
   ======================================== */
.form-container {
    max-width: 640px;
    margin: 0 auto 60px;
    padding: 48px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.form-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: #1d1d1f;
}

/* ========================================
   フォームグループ
   ======================================== */
form {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #1d1d1f;
    margin-bottom: 4px;
}

/* ========================================
   入力フィールド
   ======================================== */
input[type="text"],
input[type="email"],
select {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-family: 'Noto Sans JP', sans-serif;
    color: #1d1d1f;
    background-color: #f5f5f7;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    transition: all 0.2s ease;
    outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
    background-color: #ffffff;
    border-color: #6500CB;
    box-shadow: 0 0 0 3px rgba(101, 0, 203, 0.1);
}

input::placeholder {
    color: #86868b;
}

/* ========================================
   セレクト要素
   ======================================== */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%231d1d1f' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

/* ========================================
   日付選択グループ
   ======================================== */
.date-select-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.date-select-group select {
    width: auto;
    min-width: 80px;
    flex: 0 0 auto;
}

#dob-year {
    min-width: 90px;
}

#dob-month,
#dob-day {
    min-width: 70px;
}

.date-label {
    font-size: 14px;
    color: #1d1d1f;
    font-weight: 400;
    margin-left: -4px;
}

/* ========================================
   コース表示（AI Expert固定）
   ======================================== */
.course-display {
    font-size: 16px;
    font-weight: 500;
    color: #1d1d1f;
    padding: 12px 16px;
    background-color: #f5f5f7;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
}

/* ========================================
   ラジオボタン
   ======================================== */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px 16px;
    background-color: #f5f5f7;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.radio-label:hover {
    background-color: #ebebed;
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: #6500CB;
}

.radio-label input[type="radio"]:checked + span {
    font-weight: 500;
    color: #6500CB;
}

.radio-label span {
    font-size: 16px;
    color: #1d1d1f;
}

/* ========================================
   利用規約セクション
   ======================================== */
.agreements-section {
    border-top: 1px solid #d2d2d7;
    padding-top: 28px;
    margin-top: 12px;
}

.terms-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.terms-link-item a {
    display: inline-block;
    color: #6500CB;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.terms-link-item a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

/* ========================================
   チェックボックス
   ======================================== */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 16px;
    background-color: #f5f5f7;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    background-color: #ebebed;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    cursor: pointer;
    accent-color: #6500CB;
}

.checkbox-label span {
    font-size: 16px;
    color: #1d1d1f;
}

/* ========================================
   エラーメッセージ
   ======================================== */
.error-message {
    color: #ff3b30;
    font-size: 14px;
    margin-top: 4px;
    font-weight: 400;
}

/* ========================================
   送信ボタン
   ======================================== */
.button-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.submit-button {
    width: 100%;
    max-width: 400px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background-color: #6500CB;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(101, 0, 203, 0.2);
}

.submit-button:hover {
    background-color: #5500a8;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(101, 0, 203, 0.3);
}

.submit-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(101, 0, 203, 0.2);
}

/* ========================================
   モーダル
   ======================================== */
.modal {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: #ffffff;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    z-index: 1050;
    padding: 32px;
    border-radius: 16px;
    overflow: hidden;
}

.modal.active {
    display: block;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-content {
    margin: 0 0 24px 0;
}

.modal-content h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1d1d1f;
}

.iframe-container {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #d2d2d7;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

.modal-close {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: #6500CB;
    background-color: transparent;
    border: 1px solid #6500CB;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-block;
}

.modal-close:hover {
    background-color: #6500CB;
    color: #ffffff;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    backdrop-filter: blur(4px);
}

.modal-backdrop.active {
    display: block;
    animation: backdropFadeIn 0.3s ease;
}

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   レスポンシブデザイン (タブレット)
   ======================================== */
@media (max-width: 768px) {
    .form-container {
        padding: 32px 24px;
        margin: 0 16px 40px;
        border-radius: 12px;
    }

    .form-title {
        font-size: 20px;
        margin-bottom: 32px;
    }

    .date-select-group {
        flex-wrap: wrap;
    }

    .modal {
        width: 95%;
        padding: 24px;
    }

    .iframe-container {
        height: 400px;
    }
}

/* ========================================
   レスポンシブデザイン (スマートフォン)
   ======================================== */
@media (max-width: 480px) {
    body {
        font-size: 15px;
    }

    .header-image {
        margin-bottom: 24px;
    }

    .form-container {
        padding: 24px 16px;
        margin: 0 12px 32px;
        border-radius: 12px;
    }

    .form-title {
        font-size: 18px;
        margin-bottom: 24px;
    }

    form {
        gap: 20px;
    }

    .form-group {
        gap: 6px;
    }

    .form-group label {
        font-size: 13px;
    }

    input[type="text"],
    input[type="email"],
    select {
        padding: 10px 14px;
        padding-right: 40px;
        font-size: 15px;
    }

    .date-select-group {
        gap: 6px;
    }

    .date-select-group select {
        min-width: 70px;
        font-size: 15px;
    }

    #dob-year {
        min-width: 80px;
    }

    #dob-month,
    #dob-day {
        min-width: 60px;
    }

    .date-label {
        font-size: 13px;
    }

    .radio-group {
        gap: 10px;
    }

    .radio-label {
        padding: 10px 14px;
    }

    .radio-label span {
        font-size: 15px;
    }

    .checkbox-label {
        padding: 12px;
    }

    .checkbox-label span {
        font-size: 15px;
    }

    .terms-link-item a {
        font-size: 13px;
    }

    .submit-button {
        width: 100%;
        padding: 14px 28px;
        font-size: 15px;
    }

    .modal {
        width: 96%;
        padding: 20px;
        max-height: 85vh;
    }

    .modal-content h4 {
        font-size: 18px;
        margin-bottom: 16px;
    }

    .iframe-container {
        height: 350px;
    }

    .error-message {
        font-size: 13px;
    }
}

/* ========================================
   アクセシビリティ
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* フォーカス時の視認性向上 */
input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 2px solid #6500CB;
    outline-offset: 2px;
}
