/* ==========================================================================
   Flavor Form Handler - フロントエンドスタイル
   ========================================================================== */

.ffh-form-wrapper {
    max-width: 720px;
    margin: 2rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.ffh-form-title {
    color: #1a1a2e;
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e94560;
}

/* ---------- フォームグループ ---------- */
.ffh-form-group {
    margin-bottom: 1.25rem;
}

.ffh-form-row {
    display: flex;
    gap: 1rem;
}

.ffh-form-half {
    flex: 1;
}

/* ---------- ラベル ---------- */
.ffh-form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.ffh-required {
    color: #e94560;
}

/* ---------- 入力フィールド ---------- */
.ffh-form input[type="text"],
.ffh-form input[type="email"],
.ffh-form input[type="tel"],
.ffh-form select,
.ffh-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #fafafa;
    box-sizing: border-box;
}

.ffh-form input:focus,
.ffh-form select:focus,
.ffh-form textarea:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
    background-color: #fff;
}

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

/* ---------- エラー表示 ---------- */
.ffh-form-group.has-error input,
.ffh-form-group.has-error select,
.ffh-form-group.has-error textarea {
    border-color: #dc3545;
}

.ffh-error-text {
    display: none;
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.ffh-form-group.has-error .ffh-error-text {
    display: block;
}

/* ---------- サンプルリンク ---------- */
.ffh-sample-link {
    font-weight: normal;
    font-size: 0.85rem;
    color: #e94560;
    margin-left: 0.75rem;
    text-decoration: none;
    border-bottom: 1px dashed #e94560;
    transition: color 0.2s ease;
}

.ffh-sample-link:hover {
    color: #c73e54;
    border-bottom-color: #c73e54;
}

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

.ffh-file-upload input[type="file"] {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 2px dashed #d1d5db;
    border-radius: 6px;
    background-color: #fafafa;
    cursor: pointer;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.ffh-file-upload input[type="file"]:hover {
    border-color: #e94560;
    background-color: #fff;
}

.ffh-file-upload input[type="file"]:focus {
    outline: none;
    border-color: #e94560;
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.15);
}

.ffh-file-help {
    margin: 0.3rem 0 0;
    font-size: 0.8rem;
    color: #888;
}

.ffh-file-name {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    color: #1a1a2e;
    font-weight: 600;
}

/* ---------- 指示書プレビュー ---------- */
.ffh-instruction-preview {
    margin-top: 0.75rem;
}

.ffh-preview-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin: 0 0 0.3rem;
}

.ffh-preview-content {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    background: #f9f9f9;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    color: #333;
    margin: 0;
}

/* ---------- Word プレビュー (mammoth.js) ---------- */
.ffh-preview-content-html {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.75rem 1rem;
    background: #f9f9f9;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #333;
    margin: 0;
}

.ffh-preview-content-html p {
    margin: 0 0 0.5em;
}

.ffh-preview-content-html table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.5em 0;
}

.ffh-preview-content-html td,
.ffh-preview-content-html th {
    border: 1px solid #d1d5db;
    padding: 0.3em 0.5em;
    font-size: 0.85rem;
}

/* ---------- プライバシーポリシー ---------- */
.ffh-form-privacy label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.ffh-form-privacy input[type="checkbox"] {
    width: auto;
}

.ffh-form-privacy a {
    color: #e94560;
}

/* ---------- 送信ボタン ---------- */
.ffh-submit-btn {
    display: inline-block;
    background-color: #e94560;
    color: #ffffff;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    width: 100%;
}

.ffh-submit-btn:hover {
    background-color: #c73e54;
}

.ffh-submit-btn:active {
    transform: scale(0.98);
}

.ffh-submit-btn:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* ---------- メッセージ ---------- */
.ffh-form-message {
    padding: 1rem 1.25rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

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

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

/* ---------- 確認モーダル ---------- */
.ffh-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ffh-modal {
    background: #fff;
    border-radius: 12px;
    padding: 2rem 2.5rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: ffh-modal-in 0.2s ease;
}

@keyframes ffh-modal-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ffh-modal-title {
    font-size: 1.25rem;
    color: #1a1a2e;
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e94560;
}

.ffh-modal-body {
    margin-bottom: 1.5rem;
}

.ffh-modal-price-label {
    font-size: 0.9rem;
    color: #666;
    margin: 0 0 0.5rem;
}

.ffh-modal-price {
    margin: 0 0 1rem;
}

.ffh-modal-price #ffh-price-amount {
    font-size: 2.5rem;
    font-weight: 800;
    color: #e94560;
}

.ffh-modal-price .ffh-price-unit {
    font-size: 1rem;
    color: #333;
    margin-left: 4px;
}

.ffh-modal-size-info {
    font-size: 0.85rem;
    color: #888;
    margin: 0 0 0.25rem;
}

.ffh-modal-excel-note {
    font-size: 0.8rem;
    color: #e67e22;
    margin: 0 0 0.75rem;
}

.ffh-modal-note {
    font-size: 0.95rem;
    color: #555;
    margin: 0.75rem 0 0;
    font-weight: 600;
}

.ffh-modal-actions {
    display: flex;
    gap: 0.75rem;
}

.ffh-modal-btn {
    flex: 1;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.ffh-modal-btn:active {
    transform: scale(0.97);
}

.ffh-modal-btn-cancel {
    background: #e5e7eb;
    color: #555;
}

.ffh-modal-btn-cancel:hover {
    background: #d1d5db;
}

.ffh-modal-btn-ok {
    background: #e94560;
    color: #fff;
}

.ffh-modal-btn-ok:hover {
    background: #c73e54;
}

.ffh-modal-btn-ok:disabled {
    background: #999;
    cursor: not-allowed;
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 640px) {
    .ffh-form-wrapper {
        padding: 1.25rem;
        margin: 1rem;
    }

    .ffh-form-row {
        flex-direction: column;
        gap: 0;
    }

    .ffh-submit-btn {
        padding: 0.85rem 2rem;
    }
}
