/**
 * Chronote お問い合わせモーダル CSS
 * LP / WordPress 共通スタイル
 */

/* モーダル背景（body scroll lock） */
body.modal-open {
    overflow: hidden;
}

/* モーダルコンテナ */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.contact-modal.is-active {
    opacity: 1;
    visibility: visible;
}

/* オーバーレイ */
.contact-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

/* モーダル本体 */
.contact-modal__container {
    position: relative;
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.contact-modal.is-active .contact-modal__container {
    transform: translateY(0);
}

/* 閉じるボタン */
.contact-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #666;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
    z-index: 10;
}

.contact-modal__close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

/* ヘッダー */
.contact-modal__header {
    padding: 32px 32px 0;
    text-align: center;
}

.contact-modal__title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 12px;
}

.contact-modal__desc {
    font-size: 1.4rem;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* フォーム */
.contact-modal__form {
    padding: 24px 32px 32px;
}

.contact-modal__field {
    margin-bottom: 20px;
}

.contact-modal__field label {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.contact-modal__required {
    color: #e74c3c;
    font-size: 1.2rem;
}

.contact-modal__field input[type="text"],
.contact-modal__field input[type="email"],
.contact-modal__field textarea,
.contact-modal__field select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1.6rem;
    font-family: inherit;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.contact-modal__field input[type="text"]:focus,
.contact-modal__field input[type="email"]:focus,
.contact-modal__field textarea:focus,
.contact-modal__field select:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.15);
}

.contact-modal__field input::placeholder,
.contact-modal__field textarea::placeholder {
    color: #bbb;
}

.contact-modal__field textarea {
    resize: vertical;
    min-height: 100px;
}

.contact-modal__field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* プライバシーポリシー同意 */
.contact-modal__privacy {
    margin-top: 24px;
}

.contact-modal__checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 1.4rem;
    color: #555;
}

.contact-modal__checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #764ba2;
    cursor: pointer;
}

.contact-modal__checkbox a {
    color: #764ba2;
    text-decoration: underline;
}

.contact-modal__checkbox a:hover {
    color: #5a3680;
}

/* エラーメッセージ */
.contact-modal__errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.contact-modal__errors ul {
    margin: 0;
    padding: 0 0 0 20px;
    color: #dc2626;
    font-size: 1.4rem;
}

.contact-modal__errors li {
    margin-bottom: 4px;
}

.contact-modal__errors li:last-child {
    margin-bottom: 0;
}

/* 送信ボタン */
.contact-modal__submit {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    margin-top: 8px;
}

.contact-modal__submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.4);
    background: linear-gradient(135deg, #8b5fbf 0%, #7b91f0 100%);
}

.contact-modal__submit:active:not(:disabled) {
    transform: translateY(0);
}

.contact-modal__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.contact-modal__submit-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.contact-modal__spinner {
    animation: contact-spinner 1s linear infinite;
}

@keyframes contact-spinner {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 完了メッセージ */
.contact-modal__success {
    padding: 48px 32px;
    text-align: center;
}

.contact-modal__success-icon {
    color: #22c55e;
    margin-bottom: 24px;
}

.contact-modal__success-icon svg {
    width: 64px;
    height: 64px;
}

.contact-modal__success-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px;
}

.contact-modal__success-message {
    font-size: 1.5rem;
    color: #666;
    line-height: 1.8;
    margin: 0 0 32px;
}

.contact-modal__success-close {
    padding: 14px 48px;
    font-size: 1.5rem;
    font-weight: 600;
    color: #764ba2;
    background: transparent;
    border: 2px solid #764ba2;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.contact-modal__success-close:hover {
    background: #764ba2;
    color: #fff;
}

/* レスポンシブ */
@media all and (max-width: 600px) {
    .contact-modal__container {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .contact-modal__header {
        padding: 24px 20px 0;
    }

    .contact-modal__title {
        font-size: 1.9rem;
    }

    .contact-modal__desc {
        font-size: 1.3rem;
    }

    .contact-modal__form {
        padding: 20px 20px 24px;
    }

    .contact-modal__field {
        margin-bottom: 16px;
    }

    .contact-modal__field input[type="text"],
    .contact-modal__field input[type="email"],
    .contact-modal__field textarea,
    .contact-modal__field select {
        font-size: 1.6rem;
        padding: 12px 14px;
    }

    .contact-modal__success {
        padding: 36px 20px;
    }

    .contact-modal__success-icon svg {
        width: 48px;
        height: 48px;
    }

    .contact-modal__success-title {
        font-size: 1.9rem;
    }

    .contact-modal__success-message {
        font-size: 1.4rem;
    }
}
