/**
 * 共通フォームスタイル
 * 問い合わせフォームと会員フォームで共通使用
 */

/* === フォームコンテナ === */
.hapb-form-container,
.barom-contact-wrapper {
    max-width: 720px;
    margin: 0 auto;
}

/* 会員フォームは余白なし */
.hapb-form-container {
    max-width: none;
    margin: 0;
}

/* === ステップ表示 === */
.barom-contact-steps {
    display: flex;
    border-bottom: 1px solid currentColor;
    margin-bottom: 24px;
}

.barom-contact-step {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    font-weight: 600;
    opacity: 0.6;
}

.barom-contact-step.active {
    opacity: 1;
    border-bottom: 3px solid currentColor;
    margin-bottom: -3px;
}

.barom-contact-step.completed {
    opacity: 0.85;
}

/* === フォーム本体 === */
.hapb-form,
.barom-contact-form {
    /* 背景なし、シンプルなフォーム */
}

.hapb-form-group,
.barom-contact-form .form-row {
    margin-bottom: 1.5rem;
}

/* === ラベル === */
.hapb-form-label,
.barom-contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.hapb-form-label .required {
    color: #d32f2f;
}

/* === 入力フィールド === */
.hapb-form-input,
.barom-contact-form input[type="text"],
.barom-contact-form input[type="email"],
.barom-contact-form input[type="password"],
.barom-contact-form select,
.barom-contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 0; /* 角丸なし */
    max-width: 100%;
    font-size: 1rem;
}

.hapb-form-input:focus,
.barom-contact-form input:focus,
.barom-contact-form select:focus,
.barom-contact-form textarea:focus {
    outline: none;
    border-color: #7b68ee;
}

.barom-contact-form textarea {
    min-height: 160px;
}

/* === ヘルプテキスト === */
.hapb-form-help,
.barom-contact-form .description {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
    display: block;
}

/* === ボタン === */
.hapb-form-button,
.barom-contact-form .button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.hapb-form-button-primary,
.barom-contact-form .button-primary {
    background-color: #7b68ee;
    color: #fff;
}

.hapb-form-button-primary:hover,
.barom-contact-form .button-primary:hover {
    background-color: #5a4ac4;
}

.hapb-form-button-secondary,
.barom-contact-form .button-secondary {
    background-color: #fff;
    color: #333;
    border: 1px solid currentColor;
}

.hapb-form-button-secondary:hover,
.barom-contact-form .button-secondary:hover {
    background-color: #f5f5f5;
}

.hapb-form-button-full {
    width: 100%;
}

.hapb-form-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === フォームアクション（ボタングループ） === */
.hapb-form-actions,
.barom-contact-form .hapb-form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* === アラート・メッセージ === */
.barom-contact-alert {
    padding: 1rem;
    border: 1px solid currentColor;
    margin-bottom: 1.5rem;
}

.barom-message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid;
}

.barom-message.is-success,
.barom-contact-alert.success {
    color: #28a745;
    border-color: #28a745;
    background-color: #f0f8f4;
}

.barom-message.is-error,
.barom-contact-alert.error {
    color: #d32f2f;
    border-color: #d32f2f;
    background-color: #fef5f5;
}

/* === インラインメッセージ === */
.form-error-message {
    color: #d32f2f;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.form-success-message {
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.form-warning-message {
    color: #e65100;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.form-info-message {
    color: #01579b;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

/* === 確認画面 === */
.hapb-form-confirm,
.barom-contact-confirm {
    margin-bottom: 1.5rem;
}

.hapb-form-confirm-list,
.barom-contact-confirm table {
    width: 100%;
    border-collapse: collapse;
}

.hapb-form-confirm-list dt,
.barom-contact-confirm th {
    width: 30%;
    font-weight: 600;
    padding: 0.65rem 0;
    border-bottom: 1px solid currentColor;
    vertical-align: top;
}

.hapb-form-confirm-list dd,
.barom-contact-confirm td {
    padding: 0.65rem 0;
    border-bottom: 1px solid currentColor;
    vertical-align: top;
}

/* === フッター === */
.hapb-form-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
    text-align: center;
}

.hapb-form-footer p {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.hapb-form-footer a {
    color: #7b68ee;
    text-decoration: none;
    font-weight: 600;
}

.hapb-form-footer a:hover {
    text-decoration: underline;
}

.hapb-form-divider {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #ddd;
}

.hapb-form-divider:first-of-type {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

/* === タイトル・説明 === */
.hapb-form-title {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.hapb-form-description {
    margin-bottom: 1rem;
    color: #666;
}

/* === パスワードフィールド === */
.password-field-wrapper {
    position: relative;
}

.password-field-wrapper input {
    padding-right: 4rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    color: #7b68ee;
    font-size: 0.875rem;
    font-weight: 500;
}

.password-toggle:hover {
    color: #5a4ac4;
    text-decoration: underline;
}

/* === パスワード強度表示 === */
.password-strength {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
    font-weight: 500;
}

.password-strength.weak {
    color: #d32f2f;
}

.password-strength.medium {
    color: #f57c00;
}

.password-strength.strong {
    color: #28a745;
}

/* === 配信停止ボックス === */
.barom-unsubscribe-box {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1px solid currentColor;
}

.barom-unsubscribe-box button {
    margin-top: 0.75rem;
}

/* === バリデーションエラー表示 === */
.hapb-form-input.is-invalid,
.is-invalid {
    border-color: #d32f2f;
}

/* === レスポンシブ === */
@media (max-width: 768px) {
    .hapb-form-container,
    .barom-contact-wrapper {
        padding: 0 1rem;
    }

    .hapb-form-actions,
    .barom-contact-form .hapb-form-actions {
        flex-direction: column;
    }

    .hapb-form-button {
        width: 100%;
    }
}
