/* フォームバリデーション用CSS */

/* エラーメッセージのスタイル */
.form-errors {
    background-color: #fff3f3;
    border: 1px solid #ff0000;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}

.form-errors h4 {
    color: #ff0000;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.form-errors ul {
    margin: 0;
    padding-left: 20px;
    color: #ff0000;
}

.form-errors li {
    margin-bottom: 5px;
}

/* フィールドエラーのスタイル */
.field-error {
    color: #ff0000;
    font-size: 12px;
    margin-top: 5px;
    font-weight: normal;
}

/* エラー状態のフィールド */
input.error,
textarea.error,
select.error {
    border-color: #ff0000 !important;
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
}

/* 成功状態のフィールド */
input.success,
textarea.success,
select.success {
    border-color: #28a745 !important;
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.3);
}

/* 必須項目のラベル */
.required {
    color: #ff0000;
    font-size: 12px;
    font-weight: normal;
}

/* フォームグループのエラー状態 */
.form-group.has-error label {
    color: #ff0000;
}

.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
    border-color: #ff0000;
}

/* フォームグループの成功状態 */
.form-group.has-success label {
    color: #28a745;
}

.form-group.has-success input,
.form-group.has-success textarea,
.form-group.has-success select {
    border-color: #28a745;
}

/* エラーメッセージのアニメーション */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-errors.shake {
    animation: shake 0.5s ease-in-out;
}

/* フィールドエラーのフェードイン */
.field-error {
    opacity: 0;
    animation: fadeIn 0.3s ease-in-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ファイル入力フィールドのスタイル */
.file-input {
    border: 2px dashed #ccc;
    border-radius: 5px;
    padding: 15px;
    width: 100%;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

.file-input:hover {
    border-color: #007cba;
    background-color: #f0f8ff;
}

.file-input:focus {
    border-color: #007cba;
    background-color: #ffffff;
    outline: none;
    box-shadow: 0 0 5px rgba(0, 124, 186, 0.3);
}

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

.optional {
    color: #666;
    font-size: 12px;
    font-weight: normal;
}

/* ファイル選択後のスタイル */
.file-input.has-file {
    border-color: #28a745;
    background-color: #f8fff9;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .form-errors {
        padding: 10px;
        margin: 15px 0;
    }
    
    .form-errors h4 {
        font-size: 14px;
    }
    
    .form-errors ul {
        padding-left: 15px;
    }
    
    .field-error {
        font-size: 11px;
    }
    
    .file-input {
        padding: 10px;
    }
    
    .file-help {
        font-size: 11px;
    }
}
