/* モーダル用のスタイル */
.modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: block;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #ffffff;
    margin: 0 auto;
    width: 90%;
    max-width: 650px;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateY(30px) scale(0.95);
    display: flex;
    flex-direction: column;
}

.modal.visible .modal-content {
    transform: translateY(0) scale(1);
}

.close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.close:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

.close::before, .close::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 2px;
    background-color: currentColor;
}

.close::before {
    transform: rotate(45deg);
}

.close::after {
    transform: rotate(-45deg);
}

.consultation {
    width: 100%;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.consultation::-webkit-scrollbar {
    width: 6px;
}

.consultation::-webkit-scrollbar-track {
    background: transparent;
}

.consultation::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.consultation h2, #consultation-thanks h2 {
    margin: 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: white;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 5;
    border-radius: 12px 12px 0 0;
}

.form-container {
    padding: 2rem;
}

.form-section {
    display: flex;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.question {
    width: 100%;
    margin-bottom: 0.75rem;
}

.answer {
    width: 100%;
}

.question h3 {
    color: #1e3a8a;
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.question p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
}

.answer label {
    display: block;
    margin-bottom: 12px;
    cursor: pointer;
    transition: color 0.2s ease;
    font-size: 0.95rem;
    color: #334155;
    display: flex;
    align-items: center;
}

.answer label:hover {
    color: #2563eb;
}

.answer input[type="radio"],
.answer input[type="checkbox"] {
    margin-right: 10px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
}

.answer input[type="text"],
.answer input[type="email"],
.answer input[type="tel"],
.answer input[type="date"],
.answer select,
.answer textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    color: #334155;
    transition: all 0.2s ease;
    background-color: #f8fafc;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.answer input[type="text"]:focus,
.answer input[type="email"]:focus,
.answer input[type="tel"]:focus,
.answer input[type="date"]:focus,
.answer select:focus,
.answer textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
    background-color: #fff;
}

.answer textarea {
    height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.answer a[href*="lin.ee"] {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    padding: 8px 16px;
    background-color: #06c755;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(6, 199, 85, 0.3);
}

.answer a[href*="lin.ee"]:hover {
    background-color: #05a847;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(6, 199, 85, 0.4);
}

.date-time-pair {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.date-time-pair:last-child {
    margin-bottom: 0;
}

.date-time-pair input[type="date"],
.date-time-pair select {
    flex: 1;
    min-width: 0;
}

.required::after {
    content: " *";
    color: #ef4444;
    font-weight: 700;
}

.submit-button {
    text-align: center;
    margin: 2rem 0 0.5rem;
}

.submit-button input[type="submit"] {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 14px 36px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(213, 119, 6, 0.3);
    position: relative;
    overflow: hidden;
}

.submit-button input[type="submit"]::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transition: all 0.6s ease;
}

.submit-button input[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(213, 119, 6, 0.4);
}

.submit-button input[type="submit"]:hover::before {
    left: 100%;
}

.submit-button input[type="submit"]:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(213, 119, 6, 0.4);
}

.submit-button input[type="submit"]:disabled {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* サンクスメッセージモーダル */
#consultation-thanks .modal-content {
    max-width: 550px;
    min-height: -webkit-fill-available;
    text-align: center;
    padding-bottom: 2rem;
}

#consultation-thanks h2 {
    font-size: 1.8rem;
}

#consultation-thanks p {
    color: #334155;
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0 2rem 1rem;
    text-align: left;
}

#consultation-thanks p:last-child {
    margin-bottom: 0;
    font-size: 0.95rem;
    color: #64748b;
}

#consultation-thanks::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0) 70%);
    pointer-events: none;
}

/* 成功アイコン */
.success-icon {
    display: inline-flex;
    width: 80px;
    height: 80px;
    background-color: #10b981;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    margin: 3rem auto;
    position: relative;
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.2);
}

.success-icon::before {
    content: "";
    width: 35px;
    height: 20px;
    border-left: 4px solid white;
    border-bottom: 4px solid white;
    transform: rotate(-45deg) translate(3px, -3px);
}

/* 隠しフィールド */
.hidden {
    display: none !important;
}

/* レスポンシブデザイン */
@media screen and (min-width: 768px) {
    .question {
        width: 35%;
        padding-right: 1.5rem;
        margin-bottom: 0;
    }

    .answer {
        width: 65%;
    }

    .question h3 {
        font-size: 1.1rem;
    }
}

@media screen and (max-width: 768px) {
    .form-section {
        flex-wrap: wrap;
    }
}

@media screen and (max-width: 576px) {
    .modal-content {
        width: 95%;
    }

    .consultation h2 {
        font-size: 1.4rem;
        padding: 1.25rem 1rem;
    }

    .form-container {
        padding: 1.5rem;
    }

    .question h3 {
        font-size: 1rem;
    }

    .submit-button input[type="submit"] {
        width: 100%;
        padding: 12px 24px;
    }

    .date-time-pair {
        flex-direction: column;
        gap: 8px;
    }
}