/* ============================================
   AIB Form - フロントエンドCSS
   ============================================ */

.aibf-form-wrap {
    position: relative;
}

.aibf-form {
    width: 100%;
}

/* ---- Fields ---- */
.aibf-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.aibf-row-half {
    display: flex;
    gap: 16px;
}

.aibf-row-half .aibf-field {
    flex: 1;
}

@media (max-width: 600px) {
    .aibf-row-half {
        flex-direction: column;
        gap: 20px;
    }
}

/* ---- Label ---- */
.aibf-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: inherit;
}

.aibf-required {
    color: #e74c3c;
    font-size: 12px;
    margin-left: 4px;
    font-weight: 600;
}

/* ---- Inputs ---- */
.aibf-input,
.aibf-textarea,
.aibf-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    font-family: inherit;
    color: inherit;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

.aibf-input:focus,
.aibf-textarea:focus,
.aibf-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.aibf-input::placeholder,
.aibf-textarea::placeholder {
    color: #9ca3af;
}

.aibf-textarea {
    resize: vertical;
    min-height: 100px;
}

.aibf-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ---- Error ---- */
.aibf-field.has-error .aibf-input,
.aibf-field.has-error .aibf-textarea,
.aibf-field.has-error .aibf-select {
    border-color: #e74c3c;
}

.aibf-field-error {
    font-size: 13px;
    color: #e74c3c;
    margin-top: 4px;
}

.aibf-field-desc {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}

/* ---- Radio / Checkbox ---- */
.aibf-radio-group,
.aibf-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aibf-radio-label,
.aibf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

.aibf-radio-label input,
.aibf-checkbox-label input {
    width: auto;
    margin: 0;
}

/* ---- Submit ---- */
.aibf-submit-wrap {
    margin-top: 24px;
}

.aibf-submit-btn {
    display: inline-block;
    padding: 14px 48px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.aibf-submit-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.aibf-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ---- Messages ---- */
.aibf-message {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 16px;
}

.aibf-message.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* ---- Success ---- */
.aibf-success {
    text-align: center;
    padding: 40px 20px;
}

.aibf-success-inner {
    max-width: 400px;
    margin: 0 auto;
}

.aibf-success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.aibf-success p {
    font-size: 15px;
    line-height: 1.7;
    color: inherit;
}

/* ---- Honeypot ---- */
.aibf-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

/* ============================================
   LP用スタイル（vd-contact内で使用時）
   form_class: "aibf-vd-style"
   ============================================ */

.aibf-vd-style .aibf-label {
    color: rgba(255, 255, 255, 0.8);
}

.aibf-vd-style .aibf-required {
    color: #F97316;
}

.aibf-vd-style .aibf-input,
.aibf-vd-style .aibf-textarea,
.aibf-vd-style .aibf-select {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.aibf-vd-style .aibf-input::placeholder,
.aibf-vd-style .aibf-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.aibf-vd-style .aibf-input:focus,
.aibf-vd-style .aibf-textarea:focus,
.aibf-vd-style .aibf-select:focus {
    border-color: #2563eb;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.aibf-vd-style .aibf-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.aibf-vd-style .aibf-select option {
    background: #1e3a5f;
    color: #fff;
}

.aibf-vd-style .aibf-submit-btn {
    width: 100%;
    padding: 18px;
    background: #F97316;
    font-size: 17px;
}

.aibf-vd-style .aibf-submit-btn:hover {
    background: #ea6c0e;
}

.aibf-vd-style .aibf-field-error {
    color: #fca5a5;
}

.aibf-vd-style .aibf-field-desc {
    color: rgba(255, 255, 255, 0.4);
}

.aibf-vd-style .aibf-success-icon {
    background: #F97316;
}

.aibf-vd-style .aibf-success p {
    color: rgba(255, 255, 255, 0.8);
}

.aibf-vd-style .aibf-message.error {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.aibf-vd-style .aibf-radio-label,
.aibf-vd-style .aibf-checkbox-label {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   CTAセクション内フォームスタイル（TOPページ等）
   form_class: "aibf-cta-style"
   グラデーション背景の中に配置される前提
   ============================================ */

.cta-section-with-form {
    padding-bottom: 80px;
}

.cta-form-area {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px;
}

.aibf-cta-style .aibf-label {
    color: rgba(255, 255, 255, 0.9);
}

.aibf-cta-style .aibf-required {
    color: #fbbf24;
    font-size: 12px;
}

.aibf-cta-style .aibf-input,
.aibf-cta-style .aibf-textarea,
.aibf-cta-style .aibf-select {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    padding: 14px 16px;
    font-size: 15px;
    color: #fff;
}

.aibf-cta-style .aibf-input::placeholder,
.aibf-cta-style .aibf-textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.aibf-cta-style .aibf-input:focus,
.aibf-cta-style .aibf-textarea:focus,
.aibf-cta-style .aibf-select:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: none;
    outline: none;
}

.aibf-cta-style .aibf-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.aibf-cta-style .aibf-select option {
    background: #1e3a5f;
    color: #fff;
}

.aibf-cta-style .aibf-submit-wrap {
    text-align: center;
    margin-top: 30px;
}

.aibf-cta-style .aibf-submit-btn {
    width: 100%;
    max-width: 400px;
    padding: 18px 48px;
    background: #fff;
    color: var(--primary-color, #2563eb);
    font-size: 17px;
    font-weight: 700;
    border-radius: 6px;
    letter-spacing: 0.05em;
}

.aibf-cta-style .aibf-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.aibf-cta-style .aibf-field-error {
    color: #fca5a5;
}

.aibf-cta-style .aibf-field-desc {
    color: rgba(255, 255, 255, 0.5);
}

.aibf-cta-style .aibf-success {
    padding: 50px 20px;
}

.aibf-cta-style .aibf-success-icon {
    background: #fff;
    color: var(--primary-color, #2563eb);
}

.aibf-cta-style .aibf-success p {
    color: rgba(255, 255, 255, 0.9);
}

.aibf-cta-style .aibf-message.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.aibf-cta-style .aibf-turnstile-wrap {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.aibf-cta-style .aibf-radio-label,
.aibf-cta-style .aibf-checkbox-label {
    color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 768px) {
    .cta-form-area {
        padding: 0 10px;
    }
}
