/**
 * お問い合わせフォーム用スタイル
 * 
 * version 2025-01-27
 */

/* フォーム全体 */
.contact-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* フォーム紹介文 */
.form-intro {
    border: 1px solid #ccc;
    padding: 2rem;
    border-radius: 8px;
    margin: 0 auto 3rem auto;
    max-width: 800px;
}

.form-intro p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.form-intro .notice {
    color: #666;
    font-weight: 500;
}

.form-intro .required-notice {
    color: #dc3545;
    font-weight: 600;
    margin-bottom: 0;
}

/* フォームセクション */
.form-section {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.form-section .section-title {
    color: var(--type-castle);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--btn-color);
}

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

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-label.required::after {
    content: "＊";
    color: #dc3545;
    margin-left: 0.25rem;
}

/* フォームコントロール */
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--btn-color);
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.1);
}

.form-control::placeholder {
    color: #6c757d;
}

/* 施設選択 */
.facility-selection {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.facility-category {
    border-bottom: 1px solid #e9ecef;
}

.facility-category:last-child {
    border-bottom: none;
}

.facility-category h4 {
    background: var(--background-color);
    margin: 0;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 1px solid #e9ecef;
}

.checkbox-group {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

/* 有料老人ホームセクション内のhr */
.facility-category hr {
    width: 100%;
    margin: 0.5rem 0;
    border: none;
    border-top: 2px solid #999;
    grid-column: 1 / -1;
}

/* チェックボックス */
.checkbox-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    position: relative;
}

.checkbox-item:hover {
    background-color: #f8f9fa;
}

.checkbox-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-item:hover .checkmark {
    border-color: var(--btn-color);
}

.checkbox-item input:checked ~ .checkmark {
    background-color: var(--btn-color);
    border-color: var(--btn-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-item input:checked ~ .checkmark:after {
    display: block;
}

/* ラジオボタン */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-group.horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
}

.radio-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    position: relative;
}

.radio-item:hover {
    background-color: #f8f9fa;
}

.radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.radiomark {
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.2s ease;
}

.radio-item:hover .radiomark {
    border-color: var(--btn-color);
}

.radio-item input:checked ~ .radiomark {
    border-color: var(--btn-color);
}

.radiomark:after {
    content: "";
    position: absolute;
    display: none;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--btn-color);
    transform: translate(-50%, -50%);
}

.radio-item input:checked ~ .radiomark:after {
    display: block;
}

/* フォーム注意書き */
.form-notice {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 0.5rem;
    margin-bottom: 0;
}

/* 送信ボタン */
.submit-btn {
    background: var(--btn-color);
    color: #fff;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: inline-block;
    text-decoration: none;
    text-align: center;
    min-width: 200px;
}

.submit-btn:hover {
    background: #e68900;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    color: white;
    text-decoration: none;
}

.submit-btn:active {
    transform: translateY(0);
    background: #d17a00;
}

.submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.submit-btn i {
    margin-right: 0.5rem;
}

/* フォーム送信エリア */
.form-submit {
    text-align: center;
    margin: 3rem 0 2rem;
    padding: 2rem 0;
    border-top: 1px solid #dee2e6;
}

/* プライバシーポリシー */
.privacy-notice {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-top: 2rem;
}

.privacy-notice p {
    margin: 0;
    font-size: 0.9rem;
    color: #6c757d;
}

.privacy-notice a {
    color: var(--btn-color);
    text-decoration: none;
}

.privacy-notice a:hover {
    text-decoration: underline;
}

/* アラートメッセージ */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
}

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

.alert-success h4 {
    margin: 0 0 0.5rem 0;
    color: #155724;
    font-size: 1.1rem;
}

.alert-success p {
    margin: 0;
    line-height: 1.5;
}

/* 送信成功メッセージ */
.success-message {
    background: #f8f9fa;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.success-content i {
    font-size: 3rem;
    color: #28a745;
    margin-bottom: 1rem;
    display: block;
}

.success-content h3 {
    color: #28a745;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.success-content p {
    color: #495057;
    line-height: 1.6;
    margin: 0;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .contact-form {
        padding: 1rem 0;
    }
    
    .form-intro {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .form-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .form-section .section-title {
        font-size: 1.2rem;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
        padding: 0.75rem;
    }
    
    .radio-group.horizontal {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .submit-btn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }
    
    .form-control {
        font-size: 16px; /* iOSでズームを防ぐ */
    }
    
    .success-message {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .success-content i {
        font-size: 2.5rem;
    }
    
    .success-content h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .form-intro {
        padding: 1rem;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .facility-category h4 {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .checkbox-group {
        padding: 0.5rem;
    }
    
    .checkbox-item,
    .radio-item {
        padding: 0.25rem;
    }
}

/* アクセシビリティ */
.form-control:focus,
.checkbox-item:focus-within,
.radio-item:focus-within {
    outline: 2px solid var(--btn-color);
    outline-offset: 2px;
}

/* エラー状態 */
.form-control.error {
    border-color: #dc3545;
}

.error-message {
    background: #f8d7da;
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.error-content {
    text-align: center;
}

.error-content i {
    font-size: 2rem;
    color: #dc3545;
    margin-bottom: 0.5rem;
    display: block;
}

.error-content h4 {
    color: #721c24;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.error-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.error-content li {
    color: #721c24;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.error-content li:before {
    content: "•";
    color: #dc3545;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* 文字数カウンター */
.char-counter {
    text-align: right;
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* 入力フィールドのエラー状態 */
.form-group input.error,
.form-group textarea.error,
.form-group select.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* 成功状態 */
.form-control.success {
    border-color: #28a745;
}

/* ローディング状態 */
.submit-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-btn.loading::after {
    content: "";
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

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