/* ==========================================
   リセット & ベーススタイル
   ========================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    background: #f4f4f4;
    color: #333;
    line-height: 1.6;
    margin: 0;
    font-size: 16px;
}

/* ==========================================
   コンテナ・レイアウト
   ========================================== */
.form-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

@media (max-width: 600px) {
    .form-container {
        padding: 20px;
    }
}

/* ==========================================
   見出し
   ========================================== */
.form-container h2 {
    border-bottom: 2px solid #ff6600;
    padding-bottom: 10px;
    font-size: 1.4rem;
    margin-bottom: 25px;
    color: #333;
}

.form-container h3 {
    background: #f9f9f9;
    padding: 12px 15px;
    font-size: 1.1rem;
    margin-top: 35px;
    margin-bottom: 15px;
    border-left: 5px solid #ff6600;
    font-weight: bold;
}

/* ==========================================
   ステップインジケーター
   ========================================== */
.step-indicator {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    overflow: hidden;
    border-radius: 4px;
    background: #eee;
}

.step-indicator li {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 0.9rem;
    color: #999;
    border-right: 1px solid #fff;
    background: #e6e6e6;
    position: relative;
}

.step-indicator li:last-child {
    border-right: none;
}

.step-indicator li.active {
    background: #ff6600;
    color: #fff;
    font-weight: bold;
}

@media (max-width: 480px) {
    .step-indicator li {
        font-size: 0.75rem;
        padding: 10px 0;
    }
}

/* ==========================================
   フォーム要素
   ========================================== */
.form-container label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    margin-top: 15px;
}

.form-container input[type="text"],
.form-container input[type="tel"],
.form-container input[type="email"],
.form-container input[type="url"],
.form-container input[type="date"],
.form-container select,
.form-container textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
}

.form-container textarea {
    resize: vertical;
    min-height: 120px;
}

.form-container input[required], 
.form-container select[required] {
    background-color: #fffbfc;
}

/* ラジオボタン・チェックボックス */
.radio-group {
    margin-bottom: 15px;
}
.radio-group label {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 10px;
    font-weight: normal;
    cursor: pointer;
}
.radio-group input[type="radio"] {
    margin-right: 5px;
    transform: scale(1.2);
}

/* ==========================================
   裏面デザイン（グリッドレイアウト）
   ========================================== */
.backside-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.backside-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
}

.backside-item:hover {
    border-color: #ff6600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.backside-item label {
    cursor: pointer;
    margin: 0;
    padding: 10px;
    display: block;
    flex: 1;
    font-weight: normal;
}

.backside-img-wrap {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.backside-img {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.backside-item input[type="radio"] {
    margin-right: 5px;
    vertical-align: middle;
}

.backside-no-img {
    color: #ccc;
    font-size: 0.8rem;
}

/* ==========================================
   グリッドシステム (2列レイアウト)
   ========================================== */
.input-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 600px) {
    .input-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ==========================================
   ボタン
   ========================================== */
.btn-area {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    gap: 15px;
}

.form-container button {
    padding: 15px 30px;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    transition: background 0.3s;
    font-weight: bold;
}

.btn-next, .btn-submit {
    background: #ff6600;
    color: white;
    width: 100%;
    flex: 2;
}
.btn-next:hover, .btn-submit:hover {
    background: #e65c00;
}

.form-container button[onclick="history.back()"],
.form-container button[name="next_step"][value="2"], 
.form-container button[name="next_step"][value="3"] {
    background: #999;
    color: white;
    flex: 1;
}
.form-container button[onclick="history.back()"]:hover {
    background: #777;
}

.form-container button[type="button"][onclick*="add"] {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    padding: 8px 15px;
    font-size: 0.9rem;
    width: auto;
    margin-top: 5px;
}

.btn-price {
    display: inline-block;
    background: #0073aa;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}
.btn-price:hover {
    background: #005177;
}

/* ==========================================
   その他パーツ
   ========================================== */
.info-box {
    background: #f4faff;
    border-left: 5px solid #2c88d9;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.terms-box {
    height: 250px;
    overflow-y: scroll;
    border: 1px solid #ccc;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    background: #fdfdfd;
}

.consent-label {
    display: block;
    background: #fff0f5;
    padding: 20px;
    text-align: center;
    font-weight: bold;
    border: 2px solid #ff99cc;
    margin-bottom: 30px;
    cursor: pointer;
    border-radius: 4px;
}
.consent-label input {
    transform: scale(1.5);
    margin-right: 10px;
}

.complete-box {
    text-align: center;
    padding: 50px 20px;
}
.complete-box h2 {
    border-bottom: none;
    color: #2c88d9;
}
.complete-box a {
    display: inline-block;
    margin-top: 30px;
    padding: 10px 30px;
    background: #666;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
}

#file-inputs input[type="file"] {
    background: #f9f9f9;
    padding: 10px;
    border: 1px dashed #ccc;
}

/* ==========================================
   ポップアップ（モーダル） & 追加スタイル
   ========================================== */
.modal {
    display: none; 
    position: absolute; 
    z-index: 9999; 
    left: 0;
    width: 100%; 
    background-color: rgba(0,0,0,0.8); 
    animation: fadeIn 0.3s;
}
.modal-content {
    display: block;
    width: auto;
    max-width: 90%;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    background: #fff;
    padding: 5px;
    position: relative;
}
.modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    line-height: 1;
    z-index: 10000;
}
.modal-close:hover {
    color: #bbb;
}
@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* 複数人入力欄 */
.member-group {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    position: relative;
}
.member-group-title {
    background: #666;
    color: #fff;
    padding: 5px 10px;
    font-size: 0.9em;
    display: inline-block;
    margin-bottom: 10px;
    border-radius: 3px;
    vertical-align: middle;
}
.btn-copy-prev {
    margin-left: 15px;
    font-size: 0.8em;
    background: #fff;
    border: 1px solid #ccc;
    color: #333;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 3px;
    vertical-align: middle;
}
.btn-copy-prev:hover {
    background: #eee;
    color: #000;
}

/* 用紙選択ブロック */
.paper-select-block {
    margin-bottom: 20px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}
.paper-person-name {
    font-weight: bold;
    color: #0073aa;
    margin-bottom: 10px;
    display: block;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 5px;
}

/* ファイル削除ボタン等 */
.file-input-wrapper {
    margin-bottom: 10px;
    display: flex;
    gap: 5px;
    align-items: center;
}

/* エラーメッセージ */
.error-msg {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-weight: bold;
}

/* 管理画面用追加スタイル（予約） */
.btn-delete-mode {
    background: #d63638;
    color: white;
    border: none;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 5px;
    font-size: 0.9rem;
}
.btn-delete-mode:hover {
    background: #a0282a;
}
.ind-opt-wrapper {
    margin-top: 10px;
    padding: 10px;
    background: #fff;
    border: 1px dashed #ccc;
    border-radius: 4px;
}