/* ===================================
   Overlay Contact Form - Styles
   =================================== */
@import url('https://fonts.googleapis.com/css2?family=Sacramento&display=swap');

/* メールアイコンボタン（右下固定） */
#ocf-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99998;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#ocf-trigger:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

#ocf-trigger svg {
    pointer-events: none;
}

/* オーバーレイ全体 */
.ocf-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.ocf-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* バックドロップ（透明 — 画面全体は暗くしない） */
.ocf-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: none;
}

/* フォームコンテナ */
.ocf-overlay-content {
    position: relative;
    width: 90%;
    max-width: 520px;
    padding: 40px 36px;
    background: none;
    border: none;
    border-radius: 0;
    font-family: "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
    transform: translateY(30px);
    transition: transform 0.4s ease;
}

.ocf-overlay.is-active .ocf-overlay-content {
    transform: translateY(0);
}

/* 閉じるボタン（フォーム上・右揃え） */
.ocf-close {
    position: absolute;
    top: -12px;
    right: 0;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    transition: color 0.2s ease;
}

.ocf-close:hover {
    color: #fff;
}

/* フォームフィールド（フローティングラベル） */
.ocf-field {
    position: relative;
    margin-bottom: 36px;
}

.ocf-field label {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    z-index: 1;
    transition: all 0.25s ease;
    margin-bottom: 0;
}

/* textarea用のラベル位置（上寄せ） */
.ocf-field-textarea label {
    top: 16px;
    transform: translateY(0);
}

/* フォーカス or 入力済み → ラベルを外に浮かせる */
.ocf-field.is-focused label,
.ocf-field.is-filled label {
    top: -8px;
    left: 0;
    transform: translateY(-100%);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
}

.ocf-field label svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    transition: all 0.25s ease;
}

.ocf-field.is-focused label svg,
.ocf-field.is-filled label svg {
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.ocf-required {
    font-size: 10px;
    color: #f5a623;
    font-weight: 600;
    padding: 2px 8px;
    border: 1px solid rgba(245, 166, 35, 0.5);
    border-radius: 50px;
}

.ocf-field input[type="text"],
.ocf-field input[type="email"],
.ocf-field textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
}

.ocf-field input[type="text"]:focus,
.ocf-field input[type="email"]:focus,
.ocf-field textarea:focus {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.6);
}

/* 入力済みの背景を濃いグレーに */
.ocf-field.is-filled input[type="text"],
.ocf-field.is-filled input[type="email"],
.ocf-field.is-filled textarea {
    background: rgba(0, 0, 0, 0.65);
}

/* ブラウザ自動入力の黄色を上書き */
@keyframes ocfAutofill { from {} to {} }

.ocf-field input:-webkit-autofill,
.ocf-field input:-webkit-autofill:hover,
.ocf-field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px rgba(40, 40, 40, 0.95) inset;
    box-shadow: 0 0 0 1000px rgba(40, 40, 40, 0.95) inset;
    border-color: rgba(255, 255, 255, 0.15);
    animation-name: ocfAutofill;
}

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

/* チェックボックスフィールド */
.ocf-checkbox-field {
    text-align: center;
}

.ocf-checkbox-field label {
    position: static;
    transform: none;
    pointer-events: auto;
    display: inline-flex;
    justify-content: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
}

.ocf-checkbox-field input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #fff;
    flex-shrink: 0;
}

.ocf-checkbox-field a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ocf-checkbox-field a:hover {
    color: #fff;
}

/* 個人情報保護方針トグルリンク */
#ocf-privacy-toggle {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

#ocf-privacy-toggle:hover {
    color: #fff;
}

/* 個人情報保護方針スクロールボックス */
.ocf-privacy-box {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    padding: 0 16px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid transparent;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    line-height: 1.8;
    font-family: "Noto Sans JP", sans-serif;
    transition: max-height 0.4s ease, opacity 0.3s ease 0.05s,
                padding 0.4s ease, margin-top 0.4s ease,
                border-color 0.3s ease;
}

.ocf-privacy-box.is-open {
    max-height: 150px;
    overflow-y: auto;
    opacity: 1;
    padding: 14px 16px;
    margin-top: 8px;
    border-color: rgba(255, 255, 255, 0.12);
}

.ocf-privacy-box::-webkit-scrollbar {
    width: 4px;
}

.ocf-privacy-box::-webkit-scrollbar-track {
    background: transparent;
}

.ocf-privacy-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
}

/* エラーメッセージ（絶対配置でレイアウトに影響させない） */
.ocf-error {
    display: block;
    position: absolute;
    bottom: -20px;
    left: 0;
    color: #ff6b6b;
    font-size: 12px;
    min-height: 0;
}

.ocf-field.has-error input,
.ocf-field.has-error textarea {
    border-color: #ff6b6b;
}

/* 送信ボタン */
.ocf-submit-wrap {
    text-align: center;
    margin-top: 48px;
}

.ocf-submit {
    display: inline-block;
    padding: 12px 48px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ocf-submit:hover {
    background: #fff;
    transform: scale(1.03);
}

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

/* 送信中のスピナー */
.ocf-submit.is-loading {
    position: relative;
    color: transparent;
}

.ocf-submit.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #999;
    border-top-color: #333;
    border-radius: 50%;
    animation: ocf-spin 0.6s linear infinite;
}

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

/* 結果メッセージ */
.ocf-result {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    min-height: 0;
}

.ocf-result.is-success {
    color: #69db7c;
}

.ocf-result.is-error {
    color: #ff6b6b;
}

/* 送信完了画面 */
.ocf-thankyou {
    display: none;
    position: relative;
    z-index: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.ocf-overlay.is-sent .ocf-overlay-content {
    display: none;
}

.ocf-overlay.is-sent .ocf-thankyou {
    display: flex;
}

.ocf-thankyou-text {
    font-family: 'Sacramento', cursive;
    font-size: 64px;
    color: #fff;
    margin: 0;
    opacity: 0;
    transform: translateY(20px);
    animation: ocf-thankyou-in 0.8s ease forwards;
}

.ocf-thankyou-close {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.85);
    padding: 10px 40px;
    border-radius: 30px;
    font-size: 14px;
    font-family: "Noto Sans JP", sans-serif;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    opacity: 0;
    animation: ocf-thankyou-in 0.6s ease 0.4s forwards;
}

.ocf-thankyou-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

@keyframes ocf-thankyou-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* reCAPTCHA v3 バッジを非表示（利用規約上、フォーム内にテキスト記載で代替） */
.grecaptcha-badge {
    visibility: hidden !important;
}

.ocf-recaptcha-notice {
    position: fixed;
    bottom: 12px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
    pointer-events: auto;
}

.ocf-recaptcha-notice a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: underline;
}

/* モバイル対応 */
@media (max-width: 600px) {
    #ocf-trigger {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }

    #ocf-trigger svg {
        width: 22px;
        height: 22px;
    }

    /* オーバーレイをスクロール可能に */
    .ocf-overlay {
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ocf-overlay-content {
        width: 92%;
        max-width: none;
        padding: 48px 20px 24px;
        margin: 24px auto 40px;
    }

    /* 閉じるボタン — absolute のまま右上に */
    .ocf-close {
        position: absolute;
        top: 8px;
        right: 8px;
        font-size: 28px;
    }

    .ocf-field {
        margin-bottom: 30px;
    }

    /* iOS拡大防止: 16px以上にする */
    .ocf-field input[type="text"],
    .ocf-field input[type="email"],
    .ocf-field textarea {
        font-size: 16px;
        padding: 10px 12px;
    }

    .ocf-field label {
        font-size: 13px;
    }

    .ocf-submit-wrap {
        margin-top: 36px;
    }

    .ocf-submit {
        padding: 10px 40px;
        font-size: 14px;
    }

    /* reCAPTCHAテキストは画面下固定のまま */
    .ocf-recaptcha-notice {
        bottom: 8px;
        font-size: 10px;
    }
}
