/**
 * filein-upload.css — 入稿ページ専用スタイル
 *
 * カラーパレット:
 *   紺: #1d2988
 *   紫グラデーション: #667eea → #764ba2
 *   黄色ボタン: #f0c040 → #e0a800
 *   赤ボタン: #CC0000 → #8F1116
 *   背景薄紫: #f0f0f8
 *   成功緑: #28a745
 *   エラー赤: #dc3545
 */

/* ===== ステップインジケーター ===== */
.filein-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    padding: 0;
    list-style: none;
    gap: 0;
}

.filein-steps li {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #999;
    position: relative;
}

.filein-steps li .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ddd;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    margin-right: 8px;
    flex-shrink: 0;
}

.filein-steps li .step-label {
    white-space: nowrap;
}

.filein-steps li.active .step-number {
    background: #1d2988;
}

.filein-steps li.active .step-label {
    color: #1d2988;
    font-weight: bold;
}

.filein-steps li.completed .step-number {
    background: #28a745;
}

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

.filein-steps li .step-connector {
    width: 40px;
    height: 2px;
    background: #ddd;
    margin: 0 12px;
}

.filein-steps li.completed .step-connector {
    background: #28a745;
}

/* ===== ステップパネル共通 ===== */
.filein-panel {
    display: none;
}

.filein-panel.active {
    display: block;
}

/* ===== カード型フォーム ===== */
.filein-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 30px;
    margin: 20px 0;
}

.filein-card h3 {
    color: #1d2988;
    font-size: 20px;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #1d2988;
}

/* ===== フォームフィールド ===== */
.filein-field {
    margin-bottom: 20px;
}

.filein-field label {
    display: block;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
    font-size: 14px;
}

.filein-field label .required {
    color: #dc3545;
    font-size: 12px;
    margin-left: 4px;
}

.filein-field input[type="text"],
.filein-field input[type="email"],
.filein-field input[type="tel"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.filein-field input:focus {
    border-color: #1d2988;
    outline: none;
    box-shadow: 0 0 0 2px rgba(29, 41, 136, 0.15);
}

.filein-field input.error {
    border-color: #dc3545;
}

.filein-field .field-error {
    color: #dc3545;
    font-size: 13px;
    margin-top: 4px;
    display: none;
}

.filein-field .field-error.visible {
    display: block;
}

/* ===== ドラッグ&ドロップゾーン ===== */
.filein-dropzone {
    border: 2px dashed #1d2988;
    border-radius: 8px;
    background: #f0f0f8;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    margin: 20px 0;
}

.filein-dropzone:hover {
    background: #e8e8f4;
}

.filein-dropzone.dragover {
    background: #dde0f4;
    border-color: #667eea;
    border-style: solid;
}

.filein-dropzone .drop-icon {
    font-size: 48px;
    color: #1d2988;
    margin-bottom: 12px;
}

.filein-dropzone .drop-text {
    font-size: 16px;
    color: #333;
    font-weight: bold;
    margin-bottom: 8px;
}

.filein-dropzone .drop-subtext {
    font-size: 13px;
    color: #666;
}

.filein-dropzone .drop-formats {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
}

.filein-dropzone-input {
    display: none;
}

/* ===== ファイルリスト ===== */
.filein-file-list {
    margin: 20px 0;
}

.filein-file-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #fff;
}

.filein-file-item .file-icon {
    font-size: 24px;
    color: #1d2988;
    margin-right: 12px;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.filein-file-item .file-info {
    flex: 1;
    min-width: 0;
}

.filein-file-item .file-name {
    font-size: 14px;
    color: #333;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filein-file-item .file-size {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.filein-file-item .file-progress {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.filein-file-item .file-progress-bar {
    height: 100%;
    background: #1d2988;
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s;
}

.filein-file-item .file-progress-bar.complete {
    background: #28a745;
}

.filein-file-item .file-progress-bar.error {
    background: #dc3545;
}

.filein-file-item .file-status {
    font-size: 12px;
    margin-top: 4px;
}

.filein-file-item .file-status.uploading {
    color: #1d2988;
}

.filein-file-item .file-status.complete {
    color: #28a745;
}

.filein-file-item .file-status.error {
    color: #dc3545;
}

.filein-file-item .file-actions {
    margin-left: 12px;
    flex-shrink: 0;
    display: flex;
    gap: 6px;
}

.filein-file-item .btn-file-delete {
    background: none;
    border: 1px solid #dc3545;
    color: #dc3545;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    padding: 0;
}

.filein-file-item .btn-file-delete:hover {
    background: #dc3545;
    color: #fff;
}

.filein-file-item .btn-file-retry {
    background: none;
    border: 1px solid #1d2988;
    color: #1d2988;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s, color 0.2s;
}

.filein-file-item .btn-file-retry:hover {
    background: #1d2988;
    color: #fff;
}

/* ===== ボタン ===== */
.filein-btn-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    gap: 12px;
}

.filein-btn-group.center {
    justify-content: center;
}

.btn-filein-next {
    display: inline-block;
    background: linear-gradient(180deg, #f0c040 0%, #e0a800 100%);
    color: #333;
    font-weight: bold;
    font-size: 16px;
    padding: 12px 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.btn-filein-next:hover {
    opacity: 0.9;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.btn-filein-next:disabled {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-filein-back {
    display: inline-block;
    background: #fff;
    color: #666;
    font-size: 14px;
    padding: 10px 20px;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-filein-back:hover {
    background: #f5f5f5;
}

.btn-filein-submit {
    display: inline-block;
    background: linear-gradient(180deg, #CC0000 0%, #8F1116 100%);
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    padding: 14px 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-filein-submit:hover {
    opacity: 0.9;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

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

/* ===== 確認画面テーブル ===== */
.filein-confirm-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.filein-confirm-table th {
    background: #1d2988;
    color: #fff;
    font-size: 14px;
    padding: 10px 14px;
    text-align: left;
    white-space: nowrap;
    width: 160px;
}

.filein-confirm-table td {
    padding: 10px 14px;
    font-size: 14px;
    border-bottom: 1px solid #e0e0e0;
    background: #fafafa;
}

.filein-confirm-files {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.filein-confirm-files thead th {
    background: #1d2988;
    color: #fff;
    font-size: 13px;
    padding: 8px 12px;
    text-align: left;
}

.filein-confirm-files tbody td {
    padding: 8px 12px;
    font-size: 13px;
    border-bottom: 1px solid #e0e0e0;
}

.filein-confirm-files tbody tr:nth-child(even) {
    background: #f8f8f8;
}

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

.filein-complete .complete-icon {
    font-size: 64px;
    color: #28a745;
    margin-bottom: 16px;
}

.filein-complete h3 {
    color: #28a745;
    font-size: 24px;
    margin: 0 0 20px 0;
    border: none;
    padding: 0;
}

.filein-complete-info {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px auto;
    max-width: 500px;
    text-align: left;
}

.filein-complete-info dl {
    margin: 0;
}

.filein-complete-info dt {
    font-weight: bold;
    color: #555;
    font-size: 13px;
    margin-top: 12px;
}

.filein-complete-info dt:first-child {
    margin-top: 0;
}

.filein-complete-info dd {
    margin: 4px 0 0 0;
    font-size: 15px;
    color: #333;
}

.filein-complete-info .file-list {
    margin: 4px 0 0 0;
    padding-left: 20px;
    font-size: 14px;
}

.filein-complete .complete-notice {
    color: #666;
    font-size: 13px;
    margin: 20px 0;
}

.filein-complete .complete-links {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filein-complete .complete-links a {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
}

.filein-complete .link-retry {
    background: #1d2988;
    color: #fff;
}

.filein-complete .link-retry:hover {
    opacity: 0.9;
}

.filein-complete .link-top {
    background: #fff;
    color: #1d2988;
    border: 1px solid #1d2988;
}

.filein-complete .link-top:hover {
    background: #f0f0f8;
}

/* ===== 送信中オーバーレイ ===== */
.filein-submitting-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.filein-submitting-overlay.active {
    display: flex;
}

.filein-submitting-box {
    background: #fff;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.filein-submitting-box .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #1d2988;
    border-radius: 50%;
    animation: filein-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

.filein-submitting-box p {
    color: #333;
    font-size: 16px;
    font-weight: bold;
    margin: 0;
}

/* ===== ステップ内の注意書き ===== */
.filein-step-note {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 13px;
    color: #856404;
    margin: 12px 0;
}

/* ===== エラーメッセージ（全体） ===== */
.filein-global-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 14px;
    color: #721c24;
    margin: 12px 0;
    display: none;
}

.filein-global-error.visible {
    display: block;
}

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
    .filein-steps {
        flex-wrap: wrap;
        gap: 8px;
    }

    .filein-steps li .step-connector {
        width: 20px;
        margin: 0 6px;
    }

    .filein-steps li .step-label {
        font-size: 12px;
    }

    .filein-card {
        padding: 20px 16px;
    }

    .filein-dropzone {
        padding: 30px 16px;
    }

    .filein-btn-group {
        flex-direction: column-reverse;
    }

    .btn-filein-next,
    .btn-filein-submit {
        width: 100%;
        text-align: center;
    }

    .btn-filein-back {
        width: 100%;
        text-align: center;
    }

    .filein-confirm-table th {
        width: 100px;
        font-size: 12px;
        padding: 8px 10px;
    }

    .filein-confirm-table td {
        font-size: 13px;
        padding: 8px 10px;
    }

    .filein-file-item {
        flex-wrap: wrap;
    }

    .filein-file-item .file-actions {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .filein-steps li .step-number {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    .filein-steps li .step-connector {
        width: 12px;
        margin: 0 4px;
    }

    .filein-complete-info {
        padding: 16px;
    }
}
