/* フォーム全体ラップ */
.smart-form-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2.5rem;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

.smart-form-inner {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* フィールドスタイル */
.smart-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.smart-form-label {
    font-weight: 500;
    font-size: 0.95rem;
    color: #333;
    display: block;
}

.smart-form-required {
    color: #e63946;
    margin-left: 0.25rem;
    font-size: 0.8rem;
    vertical-align: top;
}

.smart-form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    background-color: #fafafa;
}

.smart-form-control:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
    background-color: #ffffff;
}

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

/* 送信ボタン */
.smart-form-submit-wrap {
    margin-top: 1rem;
}

.smart-form-submit-btn {
    padding: 0.85rem 2.5rem;
    background-color: #4a90e2;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    display: inline-block;
}

.smart-form-submit-btn:hover {
    background-color: #357abd;
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
}

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

.smart-form-submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* フィードバックメッセージ */
.smart-form-feedback {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
}

.smart-form-feedback.is-success {
    background-color: #e7f3ef;
    color: #2d6a4f;
    border: 1px solid #2d6a4f;
}

.smart-form-feedback.is-error {
    background-color: #fce8e8;
    color: #c53030;
    border: 1px solid #c53030;
}

/* セレクトボックス */
.smart-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23999'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* ラジオ・チェックボックス共通 */
.smart-form-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.smart-form-radio-label,
.smart-form-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.smart-form-radio,
.smart-form-checkbox {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #e0e0e0;
    background-color: #fff;
    margin: 0;
    transition: all 0.2s ease;
    cursor: pointer;
}

.smart-form-radio {
    border-radius: 50%;
}

.smart-form-checkbox {
    border-radius: 4px;
}

.smart-form-radio:checked,
.smart-form-checkbox:checked {
    border-color: #4a90e2;
    background-color: #4a90e2;
}

.smart-form-radio:checked {
    box-shadow: inset 0 0 0 3px #fff;
}

.smart-form-checkbox:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M5 13l4 4L19 7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.8rem;
}

/* ファイル送信 */
.smart-form-file-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.smart-form-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.smart-form-file-btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background-color: #f0f4f8;
    color: #4a90e2;
    border: 1px solid #d1d9e0;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.smart-form-file-btn:hover {
    background-color: #e2e8f0;
    border-color: #cbd5e0;
}

.smart-form-file-name {
    font-size: 0.85rem;
    color: #888;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* エディター内のみのスタイル（オプション） */
.smart-form-wrapper-editor {
    border: 2px dashed #ddd;
    padding: 20px;
    background: #fdfdfd;
}

.form-block-editor-label {
    font-size: 11px;
    color: #888;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.smart-form-radio-item,
.smart-form-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.smart-form-file-preview {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #eee;
}

/* エディターでの不自然なボックス表示を抑制 */
.smart-form-field-editor {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
}

.smart-form-field-editor .smart-form-field {
    padding: 0;
}

/* エディター内のブロック間の余白をフロントエンドに合わせる */
.smart-form-container :where(.block-editor-inner-blocks) > .block-editor-block-list__layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
}
/* モーダルスタイル */
.smart-form-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.smart-form-modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.smart-form-modal {
    background: #fff;
    padding: 3rem 2rem;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    max-width: 420px;
    width: 90%;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.smart-form-modal-overlay.is-active .smart-form-modal {
    transform: translateY(0) scale(1);
}

.smart-form-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    animation: modal-icon-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modal-icon-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

.smart-form-modal-icon svg {
    width: 48px;
    height: 48px;
}

.smart-form-modal-success .smart-form-modal-icon {
    background: #ecfdf5;
    color: #10b981;
}

.smart-form-modal-error .smart-form-modal-icon {
    background: #fef2f2;
    color: #ef4444;
}

.smart-form-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #1a202c;
}

.smart-form-modal-text {
    font-size: 1.05rem;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.smart-form-modal-close {
    padding: 0.85rem 2.5rem;
    background: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(74, 144, 226, 0.2), 0 2px 4px -1px rgba(74, 144, 226, 0.1);
}

.smart-form-modal-close:hover {
    background: #357abd;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(74, 144, 226, 0.3);
}

.smart-form-modal-close:active {
    transform: translateY(0);
}
