/* フォーム入力画面専用CSS */

/* 共通スタイル */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "ヒラギノ角ゴ ProN W3", "Hiragino Kaku Gothic ProN", メイリオ, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー */
.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px 0;
    margin-bottom: 30px;
}

.header h1 {
    margin: 0;
    font-size: 24px;
    color: #333;
    text-align: center;
}

/* ステップインジケーター */
.steps {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    align-items: center;
}

.step {
    display: flex;
    align-items: center;
    margin: 0 30px;
    color: #999;
    position: relative;
}

.step::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 2px;
    background-color: #ddd;
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
}

.step:last-child::after {
    display: none;
}

.step-number {
    width: 40px;
    height: 40px;
    background-color: #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-weight: bold;
    font-size: 16px;
}

.step.active .step-number {
    background-color: #007bff;
    color: #fff;
}

.step.completed .step-number {
    background-color: #28a745;
    color: #fff;
}

.step-label {
    font-weight: 500;
    font-size: 16px;
}

.step.active .step-label {
    color: #007bff;
}

.step.completed .step-label {
    color: #28a745;
}

/* フォームコンテナ */
.form-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 40px;
}

/* フォームセクション */
.form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
    border-left: 4px solid #007bff;
    padding-left: 12px;
}

.form-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #555;
}

/* フォームグループ */
.form-group {
    margin-bottom: 20px;
}

.form-label,
label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.required {
    color: #dc3545;
    margin-left: 4px;
    font-weight: normal;
}

/* 入力フィールド */
.form-control,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px !important;
    transition: border-color 0.3s;
    background-color: #fff;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

.form-control.error,
input.error,
select.error,
textarea.error {
    border-color: #dc3545;
}

textarea.form-control,
textarea {
    resize: vertical;
    min-height: 100px;
}

/* 事業内容と会社概要のテキストエリア調整 */
textarea[name="business_content"],
textarea[name="company_overview"],
textarea[name="branch_info"],
textarea[name="recruitment_info"],
textarea[name="other_shared_items"] {
    line-height: 1.5;
    font-size: 14px !important;
}

/* 会社概要のフォントサイズを小さく、高さを少し大きく */
textarea[name="company_overview"] {
    min-height: 420px;
}

/* その他共有項目の高さ調整 */
textarea[name="other_shared_items"] {
    min-height: 260px;
}

.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* 複数列レイアウト */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* ラジオボタン・チェックボックス */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-inline,
.checkbox-inline {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
}

.radio-item,
.checkbox-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
}

.radio-item input[type="radio"],
.checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 2px;
    flex-shrink: 0;
}

.radio-item label,
.checkbox-item label {
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
    flex: 1;
}

/* 住所入力フィールド */
.address-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

/* 訪問ディレクション住所を目立たせる */
.visit-address-section {
    background-color: #f0f7ff;
    border: 2px solid #4a90e2;
    border-radius: 8px;
    padding: 20px;
    margin-top: 25px;
    position: relative;
}

.visit-address-section .form-label {
    color: #2c5aa0;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 15px;
}

.postal-code-group {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.postal-input {
    width: 120px !important;
}

input.postal-input,
.form-control.postal-input {
    width: 120px !important;
    max-width: 120px !important;
}

.postal-code-group {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
}

.postal-search-btn {
    padding: 8px 16px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.postal-search-btn:hover {
    background-color: #5a6268;
}

.prefecture-select {
    width: 150px;
}

/* 受注日フィールドの調整 */
input[type="date"] {
    max-width: 200px;
}

/* 日付フィールドでカレンダーを即座に表示 */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    padding: 4px;
}

input[type="date"]:focus::-webkit-calendar-picker-indicator {
    background: transparent;
}

/* ファイルアップロード */
.file-input-wrapper {
    position: relative;
}

.file-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.file-info {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c82333;
}

.form-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

/* 必須フィールドエラー時のハイライト */
.form-label.field-error {
    background-color: bisque !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    border: 2px solid #ff6b6b !important;
    animation: shake 0.5s ease-in-out;
}

/* ラジオボタン・チェックボックス内のラベルには適用しない */
.radio-item label.field-error,
.checkbox-item label.field-error {
    background-color: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    animation: none !important;
}

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

/* エラー・成功メッセージ */
.alert {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
}

/* 確認画面用テーブル */
.confirm-table {
    width: 100%;
    background-color: #fff;
    border-collapse: collapse;
}

.confirm-table th,
.confirm-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    border-top: 1px solid #ddd;
}

.confirm-table tr:first-child th,
.confirm-table tr:first-child td {
    border-top: 1px solid #ddd;
}

.confirm-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #555;
    width: 30%;
}

.confirm-table tr:hover {
    background-color: #f8f9fa;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .steps {
        flex-direction: column;
        align-items: center;
    }
    
    .step {
        margin: 10px 0;
    }
    
    .step::after {
        display: none;
    }
    
    .form-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
    }
    
    .radio-inline,
    .checkbox-inline {
        flex-direction: column;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .postal-code-group {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ローディング */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,0.1);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
}

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

/* その他の詳細入力 */
.other-input {
    margin-top: 10px;
    display: none;
}

.other-input.show {
    display: block;
}

/* 完了画面 */
.complete-message {
    text-align: center;
    padding: 40px;
}

.complete-message h2 {
    color: #28a745;
    margin-bottom: 20px;
}

.complete-icon {
    font-size: 60px;
    color: #28a745;
    margin-bottom: 20px;
}

/* プリント対応 */
@media print {
    body {
        background: white;
    }
    
    .header,
    .steps,
    .form-buttons,
    .btn {
        display: none;
    }
    
    .form-container {
        box-shadow: none;
        padding: 0;
    }
}

/* Progress Indicator Styles */
.progress-indicator {
    position: fixed;
    bottom: 55px;
    right: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    z-index: 1000;
    min-width: 180px;
    transition: all 0.3s ease;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.progress-indicator.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    pointer-events: none;
}

.progress-indicator:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

.progress-indicator-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-indicator-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.progress-label {
    color: #666;
    font-weight: 500;
}

.progress-percentage {
    color: #007bff;
    font-weight: 700;
    font-size: 18px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff 0%, #0056b3 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

/* Complete state */
.progress-indicator.complete .progress-percentage {
    color: #28a745;
}

.progress-indicator.complete .progress-bar-fill {
    background: linear-gradient(90deg, #28a745 0%, #1e7e34 100%);
}

/* Updating animation */
.progress-indicator.updating {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .progress-indicator {
        bottom: 20px;
        right: 20px;
        min-width: 150px;
        padding: 12px 16px;
    }
    
    .progress-percentage {
        font-size: 16px;
    }
    
    .progress-label {
        font-size: 12px;
    }
}

/* Hide on print */
@media print {
    .progress-indicator {
        display: none;
    }
}