:root {
    --primary-color: #007bff;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --white: #fff;
    --border-color: #ccc;
}

body {
    font-family: 'Noto Sans JP', 'Helvetica Neue', 'Arial', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
    background-color: var(--white);
    color: var(--dark-gray);
    line-height: 1.6;
    margin: 0;
    font-weight: normal;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px 0;
    /* background-color: var(--white); removed */
    /* border-radius: 8px; removed */
    /* box-shadow: 0 2px 8px rgba(0,0,0,0.06); removed */
}

h1 {
    text-align: center;
    color: var(--dark-gray);
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 1.7em;
}

h2 {
    font-size: 1.2em;
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: bold;
    font-family: 'Helvetica Neue', 'Arial', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
}

h3 {
    font-size: 1.1em;
    font-weight: bold;
    font-family: 'Helvetica Neue', 'Arial', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
    color: inherit;
    margin-top: 20px;
    margin-bottom: 0px !important;
}

h3+p {
    margin-top: 0px !important;
}

strong {
    font-weight: bold;
    font-family: 'Helvetica Neue', 'Arial', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Meiryo', sans-serif;
}

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

.total-amount-display {
    text-align: center;
    margin-bottom: 25px;
    padding: 15px;
    background-color: #e9f5ff;
    border-radius: 5px;
}

.total-amount-display h3 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
    color: var(--primary-color);
    font-weight: normal;
}

.total-amount-display p {
    margin: 0;
    font-size: 2em;
    font-weight: 600;
    color: var(--dark-gray);
}

.total-amount-display .tax-note {
    font-size: 0.5em;
    font-weight: normal;
}

.course-selection .course-item {
    display: block;
    margin-bottom: 20px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: background-color 0.2s;
    cursor: pointer;
}

.course-selection .course-item:has(input:checked) {
    background-color: #fdfde8;
    border-color: #f5c518;
}

.course-selection .course-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 1em;
    font-weight: normal;
}

.course-selection .course-header strong {
    margin-right: 10px;
    white-space: nowrap;
}

.course-selection input[type="radio"],
.course-selection input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
}

.course-selection .price {
    margin-left: auto;
    font-weight: normal;
    white-space: nowrap;
}

.course-detail {
    padding-left: 28px;
    font-size: 0.95em;
    color: #000;
}

#starterSetInfo {
    background-color: #f1f1f1;
    padding: 15px;
    border-radius: 5px;
}

#discountInfo {
    color: #000;
    font-weight: normal;
    padding: 0;
    background-color: transparent;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        width: 94%;
        margin: 0 auto;
        padding: 0;
    }

    h1 {
        font-size: 1.4em;
    }

    .total-amount-display p {
        font-size: 1.6em;
    }

    /* Removed column layout for course selection on mobile */
    .course-selection .price {
        margin-left: auto;
        /* Ensure price stays on the right */
        margin-top: 0;
    }

    /* カレンダー入力のスマホ対応 */
    input[type="date"] {
        width: calc(100% - 10px) !important;
        max-width: calc(100% - 10px) !important;
        box-sizing: border-box !important;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        padding: 8px !important;
        height: 34px !important;
    }

    /* Safari iOS用の追加調整 */
    input[type="date"]::-webkit-date-and-time-value {
        text-align: left;
    }
}

.form-submit-area {
    display: grid;
    grid-template-columns: 1fr 8fr 1fr;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    margin-bottom: 30px;
}

.button-primary {
    background-color: #2e68e0;
    color: #fff;
    border: none;
    padding: 12px 10px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    width: 100%;
}

.button-primary:hover {
    opacity: 0.8;
}

.button-primary:disabled {
    background-color: #ccc;
    color: #fff;
    cursor: not-allowed;
}

/* --- Customer Info Page Styles --- */
.summary-section {
    border: 2px solid var(--primary-color);
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 10px 15px;
    margin-bottom: 30px;
}

.summary-item {
    padding: 5px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.9em;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item .label {
    font-weight: normal;
    color: #000 !important;
}

.summary-item .value {
    padding-left: 10px;
    font-weight: 600;
    display: block;
}

.summary-item.total .value {
    font-size: 1.2em;
    font-weight: 600;
    padding-left: 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: normal;
    color: #000 !important;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
}

.required {
    background-color: #dc3545;
    color: white;
    font-size: 0.7em;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
}

.note {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 5px;
}

.radio-label,
.checkbox-label {
    font-weight: normal;
    margin-right: 15px;
    color: #000 !important;
}

.course-date-group {
    border: 1px solid var(--border-color);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 5px;
}

.course-date-group .course-date-title {
    font-weight: 600;
    margin-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.terms-section {
    margin-top: 30px;
    text-align: center;
    font-size: 0.9em;
}

.terms-section a {
    color: var(--primary-color);
    text-decoration: underline;
}

.button-group {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.button-group button {
    margin: 0 10px;
}

.button-secondary {
    background-color: #999;
    color: #fff;
    border: none;
    padding: 12px 10px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    width: 100%;
}

.button-secondary:hover {
    opacity: 0.8;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    /* JSで切り替え */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--dark-gray);
    color: var(--white);
    padding: 20px 30px;
    border-radius: 8px;
    width: 80%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    /* 枠自体の追加スクロールを防ぐ */
    position: relative;
    display: flex;
    flex-direction: column;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.8em;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

.terms-text {
    font-size: 0.9em;
    line-height: 1.7;
    overflow-y: auto;
    /* 文章のみをスクロール可能に */
    padding-right: 10px;
}

.terms-text>h4:first-child {
    text-align: center;
    margin-bottom: 20px;
}

/* --- Confirm Payment Page Styles --- */
.order-summary-section {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 30px;
}

.summary-block {
    padding: 10px 15px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-block:last-child {
    border-bottom: none;
}

.summary-block p {
    margin: 0;
}

.item-name {
    font-weight: 600;
}

.item-calc {
    text-align: right;
    color: #333;
    font-size: 1.1em;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.quantity-btn {
    background: #eee;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-weight: bold;
}

.quantity-input {
    width: 40px;
    text-align: center;
    border: none;
    border-left: 1px solid #ccc;
    border-right: 1px solid #ccc;
}

.total-section {
    padding: 15px;
    background-color: #abffce;
    /* Light Green */
    border-left: 4px solid #4caf50;
    /* Green */
}

.total-section .notice {
    color: #dc3545;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.total-section .total-amount {
    text-align: right;
    font-size: 1.4em;
    font-weight: bold;
}

.payment-method-section,
.shipping-info-section {
    margin-bottom: 30px;
}

.address-display {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

/* --- Final Confirm Page Styles --- */
.confirm-info-table {
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 20px;
}

.info-row {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: normal;
    color: #6c757d;
    font-size: 0.85em;
}

.info-data {
    padding-left: 10px;
    font-weight: 600;
    white-space: pre-wrap;
    /* 質問などの長いテキストを折り返す */
}

/* --- Thanks Page Styles --- */
.thanks-message {
    text-align: center;
    padding: 40px 20px;
}

.thanks-message h1 {
    font-size: 1.7em;
}

.thanks-message p {
    font-size: 1em;
    line-height: 1.6;
}