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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    background: linear-gradient(135deg, #0F3460 0%, #1A2859 50%, #16213E 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   コンテナ
======================================== */
.container {
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: fadeIn 0.5s ease;
}

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

/* ========================================
   ヘッダー
======================================== */
.header {
    background: linear-gradient(135deg, #1A2859 0%, #3D5A80 100%);
    padding: 30px 20px;
    text-align: center;
    color: #ffffff;
}

.header-image {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin-bottom: 15px;
    border-radius: 8px;
}

.title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

/* ========================================
   案内ボックス
======================================== */
.info-box {
    background: linear-gradient(135deg, #E8F0FE 0%, #F0F4FF 100%);
    padding: 20px;
    margin: 20px;
    border-radius: 12px;
    border-left: 4px solid #1A2859;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #1A2859;
}

.info-item:last-child {
    margin-bottom: 0;
}

.icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #3D5A80;
}

.icon-small {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.icon-medium {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

/* ========================================
   説明テキスト
======================================== */
.description {
    padding: 0 20px 20px;
    font-size: 14px;
    line-height: 1.8;
    color: #555;
    border-bottom: 1px solid #e0e0e0;
}

/* ========================================
   フォームセクション
======================================== */
form {
    padding: 20px;
}

.form-section {
    margin-bottom: 30px;
}

.form-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1A2859;
    margin-bottom: 10px;
}

.form-label.required::after {
    content: "必須";
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #E63946;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
}

.field-note {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
    line-height: 1.5;
}

.instruction-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #FFF9E6 0%, #FFF3D6 100%);
    border-left: 4px solid #F59E0B;
    border-radius: 12px;
    margin-bottom: 12px;
}

.instruction-box .icon-medium {
    color: #F59E0B;
    margin-top: 2px;
}

.instruction-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.7;
    color: #92400E;
}

.instruction-text strong {
    color: #78350F;
    font-weight: 700;
}

.instruction-text .sub-note {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    color: #A16207;
    font-style: italic;
}

.selection-note {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: #E8F0FE;
    border-radius: 8px;
    font-weight: 600;
    color: #1A2859;
    margin-bottom: 15px;
}

/* ========================================
   入力フィールド
======================================== */
.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #3D5A80;
    box-shadow: 0 0 0 4px rgba(61, 90, 128, 0.1);
}

/* ========================================
   カレンダーナビゲーション
======================================== */
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: linear-gradient(135deg, #1A2859 0%, #3D5A80 100%);
    border-radius: 12px;
    margin-bottom: 15px;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-btn svg {
    width: 20px;
    height: 20px;
    color: #ffffff;
}

.current-month {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

/* ========================================
   カレンダーグリッド
======================================== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.calendar-day {
    aspect-ratio: 1;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ffffff;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.calendar-day.day-label {
    font-size: 12px;
    font-weight: 700;
    color: #666;
    border: none;
    cursor: default;
    background: transparent;
}

.calendar-day.disabled {
    color: #ccc;
    background: #f5f5f5;
    cursor: not-allowed;
    border-color: #f0f0f0;
}

.calendar-day:not(.disabled):not(.day-label):hover {
    border-color: #3D5A80;
    background: #E8F0FE;
}

.calendar-day:not(.disabled):not(.day-label):active {
    transform: scale(0.95);
}

.calendar-day.selected {
    background: linear-gradient(135deg, #1A2859 0%, #3D5A80 100%);
    border-color: #1A2859;
    color: #ffffff;
}

.calendar-day .day-number {
    font-size: 16px;
}

.calendar-day .day-weekday {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 2px;
}

/* ========================================
   時間選択モーダル
======================================== */
.time-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.time-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.3s ease;
}

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

.time-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.time-modal-header h3 {
    font-size: 20px;
    color: #1A2859;
    font-weight: 700;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #e0e0e0;
}

.close-btn svg {
    width: 18px;
    height: 18px;
    color: #666;
}

.time-note {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
    padding: 10px;
    background: #F0F4FF;
    border-radius: 8px;
}

.time-slots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}

.time-slot {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ffffff;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.time-slot:hover {
    border-color: #3D5A80;
    background: #E8F0FE;
}

.time-slot:active {
    transform: scale(0.95);
}

.time-slot.selected {
    background: linear-gradient(135deg, #1A2859 0%, #3D5A80 100%);
    border-color: #1A2859;
    color: #ffffff;
    pointer-events: none;
    opacity: 0.7;
}

/* ========================================
   選択済み日程表示
======================================== */
.selected-slots {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.selected-slot-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #E8F0FE 0%, #F0F4FF 100%);
    border-left: 4px solid #1A2859;
    border-radius: 8px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slot-info {
    flex: 1;
}

.slot-number {
    font-size: 11px;
    font-weight: 700;
    color: #3D5A80;
    margin-bottom: 4px;
}

.slot-datetime {
    font-size: 15px;
    font-weight: 600;
    color: #1A2859;
}

.remove-slot-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(230, 57, 70, 0.1);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.remove-slot-btn:hover {
    background: rgba(230, 57, 70, 0.2);
}

.remove-slot-btn svg {
    width: 18px;
    height: 18px;
    color: #E63946;
}

/* ========================================
   チェックボックスグループ
======================================== */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 56px;
}

.checkbox-item:active {
    background: rgba(61, 90, 128, 0.05);
}

.checkbox-item.checked {
    background: linear-gradient(135deg, #E8F0FE 0%, #F0F4FF 100%);
    border-color: #3D5A80;
}

.checkbox-input {
    width: 22px;
    height: 22px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #1A2859;
    flex-shrink: 0;
}

.checkbox-label {
    font-size: 15px;
    color: #333;
    line-height: 1.5;
    cursor: pointer;
}

.checkbox-item.checked .checkbox-label {
    color: #1A2859;
    font-weight: 600;
}

/* ========================================
   エラーメッセージ
======================================== */
.error-message {
    color: #E63946;
    font-size: 13px;
    margin-top: 6px;
    display: none;
}

.error-message.show {
    display: block;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ========================================
   送信ボタン
======================================== */
.submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #1A2859 0%, #3D5A80 100%);
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(26, 40, 89, 0.3);
    margin-top: 30px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 40, 89, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-icon {
    width: 22px;
    height: 22px;
}

/* ========================================
   ローディング
======================================== */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 2000;
}

.loading.show {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: #ffffff;
    margin-top: 15px;
    font-size: 16px;
}

/* ========================================
   完了オーバーレイ
======================================== */
.success-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.success-overlay.show {
    display: flex;
}

.success-message {
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    margin: 20px;
    animation: popIn 0.4s ease;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: #ffffff;
    stroke-width: 3;
}

.success-message h2 {
    font-size: 24px;
    color: #1A2859;
    margin-bottom: 10px;
}

.success-message p {
    font-size: 15px;
    color: #666;
    line-height: 1.6;
}

/* ========================================
   レスポンシブ調整
======================================== */
@media (max-width: 480px) {
    body {
        padding: 10px 0;
    }

    .container {
        border-radius: 0;
        margin: 0;
    }

    .title {
        font-size: 20px;
    }

    .time-slots {
        grid-template-columns: repeat(2, 1fr);
    }

    .calendar-day .day-number {
        font-size: 14px;
    }

    .submit-btn {
        font-size: 16px;
        padding: 16px;
    }
}