/* Contact Form Styles */

.contact__card {
    position: relative;
    transition: all 0.3s ease;
}

.contact__form-group {
    background: #1a1a1a;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid #333;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.contact__form-group--dropdown {
    z-index: 10;
}

.contact__form-group:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.08);
    border-color: #333;
}

.contact__form-group::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: transparent;
    transition: background 0.3s ease;
}

.contact__form-group:focus-within::before {
    background: #00ff88;
}

.contact__label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #fff;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.contact__required {
    color: #00ff88;
}

.contact__input, .contact__textarea, .contact__select {
    width: 100%;
    padding: 16px;
    border: none;
    border-bottom: 2px solid #333;
    font-size: 16px;
    background: transparent;
    transition: all 0.3s ease;
    color: #fff;
    font-family: inherit;
}

.contact__input:focus, .contact__textarea:focus, .contact__select:focus {
    outline: none;
    border-bottom-color: #333;
    color: #fff;
}

.contact__input::placeholder, .contact__textarea::placeholder {
    color: #666;
    font-style: italic;
}

.contact__textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.contact__select {
    cursor: pointer;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23fff" stroke-width="2"><polyline points="6,9 12,15 18,9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    appearance: none;
}

/* Custom Select Styles */
.contact__select-wrapper {
    position: relative;
    width: 100%;
    isolation: isolate;
    z-index: 10;
}

.contact__select-button {
    width: 100%;
    padding: 16px;
    border: none;
    border-bottom: 2px solid #333;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.contact__select-button:focus,
.contact__select-button.active {
    outline: none;
    border-bottom-color: #333;
}

.contact__select-text {
    flex: 1;
    text-align: left;
    color: #666;
}

.contact__select-text.selected {
    color: #fff;
}

.contact__select-arrow {
    color: #fff;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.contact__select-button.active .contact__select-arrow {
    transform: rotate(180deg);
}

.contact__select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0a0a0a;
    border: 1px solid #333;
    border-top: none;
    max-height: 0;
    overflow: hidden;
    z-index: 50;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    user-select: none;
}

.contact__select-dropdown.open {
    max-height: 300px;
    overflow-y: hidden;
    pointer-events: auto;
}

/* Custom scrollbar styles (hidden) */
.contact__select-dropdown::-webkit-scrollbar {
    display: none;
}

.contact__select-dropdown {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.contact__option {
    padding: 16px 20px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px solid #333;
    position: relative;
    background: #0a0a0a;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.contact__option:last-child {
    border-bottom: none;
}

.contact__option:hover {
    background: rgba(255, 255, 255, 0.1);
    padding-left: 24px;
    z-index: 100;
}

.contact__option:active {
    background: rgba(0, 255, 136, 0.1);
}

/* Radio Button Styles */
.contact__radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-top: 8px;
}

.contact__radio-item {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    padding: 6px 8px;
    transition: all 0.3s ease;
    border-radius: 6px;
    white-space: nowrap;
}

.contact__radio-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.contact__radio {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #333;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    flex-shrink: 0;
}

.contact__radio:focus {
    outline: none;
    border-color: #00ff88;
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.2);
}

.contact__radio:checked {
    border-color: #00ff88;
    background: #0a0a0a;
}

.contact__radio:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00ff88;
}

.contact__radio-label {
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    transition: color 0.3s ease;
    user-select: none;
}

.contact__radio-item:hover .contact__radio-label {
    color: #00ff88;
}

.contact__radio:checked + .contact__radio-label {
    color: #00ff88;
    font-weight: 500;
}

/* Focus and validation for radio group */
/* ラジオボタンフォーカス時のボーダー変更を無効化 */

.contact__button {
    background: #6c757d;
    color: #fff;
    border: 1px solid #555;
    padding: 18px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    position: relative;
    margin-bottom: 30px;
}

.contact__button:hover:not(:disabled) {
    background: #00ff88;
    color: #000;
    border-color: #00ff88;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 255, 136, 0.3);
}

.contact__button:active {
    transform: translateY(-1px);
}

.contact__message {
    padding: 15px 20px;
    margin-bottom: 25px;
    font-weight: 500;
    display: none;
    text-align: center;
    animation: slideIn 0.3s ease-out;
    border: 1px solid #333;
}

.contact__message--success {
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    border-color: #00ff88;
}

.contact__message--error {
    background: rgba(255, 0, 0, 0.1);
    color: #ff4444;
    border-color: #ff4444;
}

.contact__privacy-note {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #333;
    border-left: 4px solid #00ff88;
}

.contact__privacy-note p {
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.contact__privacy-note a {
    color: #00ff88;
    text-decoration: none;
    font-weight: 600;
}

.contact__privacy-note a:hover {
    text-decoration: underline;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .contact {
        padding: 60px 0;
    }

    .contact__title {
        font-size: 2rem;
    }
    
    .contact__radio-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .contact__radio-item {
        padding: 12px 0;
    }
    
    .contact__radio-label {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .contact {
        padding: 40px 0;
    }
    
    .contact__title {
        font-size: 1.8rem;
    }
    
    .contact__description {
        font-size: 1rem;
    }
    
    .contact__form-container {
        padding: 0;
    }
    
    .contact__form-group {
        padding: 18px;
    }
}

/* Focus and validation styles */
.contact__form-group:focus-within .contact__label {
    color: #fff;
}

.contact__input:invalid:not(:placeholder-shown),
.contact__textarea:invalid:not(:placeholder-shown) {
    border-bottom-color: #00cc70;
}

.contact__input:valid:not(:placeholder-shown),
.contact__textarea:valid:not(:placeholder-shown) {
    border-bottom-color: #333;
}

/* オートフィル時の背景色を上書き */
.contact__input:-webkit-autofill,
.contact__input:-webkit-autofill:hover,
.contact__input:-webkit-autofill:focus,
.contact__textarea:-webkit-autofill,
.contact__textarea:-webkit-autofill:hover,
.contact__textarea:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    -webkit-text-fill-color: #fff !important;
    background-color: transparent !important;
    transition: background-color 5000s ease-in-out 0s;
}

@keyframes focusGlow {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.1); }
    70% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.contact__form-group:focus-within {
    animation: focusGlow 0.6s ease-out;
}

/* Character counter */
.contact__char-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.8rem;
    color: #666;
    background: rgba(0, 0, 0, 0.8);
    padding: 4px 8px;
    transition: color 0.3s ease;
    border: 1px solid #333;
}

/* プライバシーポリシー同意チェックボックスのスタイル */
.contact__privacy-consent {
    margin: 24px 0;
    padding: 20px;
    background: rgba(0, 255, 136, 0.05);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.contact__privacy-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1.5;
}

.contact__privacy-checkbox {
    appearance: none;
    width: 0;
    height: 0;
    margin: 0;
    flex-shrink: 0;
    position: absolute;
}

.contact__privacy-checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.contact__privacy-checkbox:disabled + .contact__privacy-checkmark {
    border-color: #ccc;
    background: #f5f5f5;
    cursor: not-allowed;
}

.contact__privacy-checkbox:enabled + .contact__privacy-checkmark {
    border-color: #00ff88;
    cursor: pointer;
}

.contact__privacy-checkbox:enabled + .contact__privacy-checkmark:hover {
    border-color: #00cc66;
    background: rgba(0, 255, 136, 0.1);
}

.contact__privacy-checkbox:checked + .contact__privacy-checkmark {
    background: #00ff88;
    border-color: #00ff88;
}

.contact__privacy-checkbox:checked + .contact__privacy-checkmark::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 0px;
    width: 6px;
    height: 12px;
    border: solid #000;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.contact__privacy-text {
    color: #fff;
}

.contact__privacy-link {
    color: #00ff88;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.3s ease;
}

.contact__privacy-link:hover {
    color: #00cc66;
}

.contact__privacy-status {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

/* 送信ボタンの無効化スタイル */
.contact__button:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* プライバシーポリシーモーダル */
.privacy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
}

.privacy-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.privacy-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.privacy-modal__container {
    position: relative;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background: #1a1a1a;
    border: 1px solid #333;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.privacy-modal__header {
    padding: 25px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1a1a1a;
}

.privacy-modal__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
}

.privacy-modal__close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.privacy-modal__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.privacy-modal__content {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    max-height: 60vh;
    color: #ccc;
    line-height: 1.6;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 136, 0.3) #1a1a1a;
}

.privacy-modal__content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.privacy-modal__content::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-left: 1px solid #333;
}

.privacy-modal__content::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 136, 0.3);
    border: none;
    transition: background 0.3s ease;
}

.privacy-modal__content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 136, 0.6);
}

.privacy-modal__content::-webkit-scrollbar-thumb:active {
    background: #00ff88;
}

.privacy-policy h3 {
    color: #fff;
    margin: 24px 0 12px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.privacy-policy h3:first-child {
    margin-top: 0;
}

.privacy-policy p {
    margin: 12px 0;
    line-height: 1.6;
    color: #ccc;
}

.privacy-policy ul {
    margin: 12px 0;
    padding-left: 24px;
}

.privacy-policy li {
    margin: 6px 0;
    color: #ccc;
    line-height: 1.5;
}

.privacy-policy__date {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid #333;
    font-size: 0.9rem;
    color: #aaa;
    text-align: right;
}

.privacy-modal__footer {
    padding: 25px;
    border-top: 1px solid #333;
    background: #1a1a1a;
}

.privacy-modal__scroll-notice {
    position: absolute;
    bottom: 120px;
    left: 25px;
    right: 25px;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid #00ff88;
    color: #00ff88;
    padding: 15px 20px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 1;
    transition: all 0.5s ease;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.privacy-modal__scroll-notice.fade-out {
    opacity: 0;
    pointer-events: none;
}

.privacy-modal__scroll-notice.hidden {
    display: none;
}

.privacy-modal__actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.privacy-modal__button {
    font-size: 1.1rem;
    cursor: pointer;
    text-align: center;
}

.privacy-modal__button--agree {
    flex: 1;
    padding: 18px 40px;
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
    border: 2px solid rgba(0, 255, 136, 0.3);
    font-weight: 600;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.privacy-modal__button--agree:hover:not(:disabled) {
    background: rgba(0, 255, 136, 0.2);
    border-color: #00ff88;
}

.privacy-modal__button--agree:disabled {
    background: rgba(0, 255, 136, 0.05);
    color: rgba(0, 255, 136, 0.3);
    cursor: not-allowed;
    border-color: rgba(0, 255, 136, 0.1);
}

.privacy-modal__button--cancel {
    flex: 1;
    padding: 15px 30px;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.privacy-modal__button--cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

/* トースト通知アニメーション */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* レスポンシブ対応 - プライバシーモーダル */
@media (max-width: 768px) {
    .privacy-modal__container {
        width: 95%;
        max-height: 95vh;
    }

    .privacy-modal__header,
    .privacy-modal__footer {
        padding: 16px 20px;
    }

    .privacy-modal__content {
        padding: 20px;
    }

    .privacy-modal__title {
        font-size: 1.3rem;
    }

    .privacy-modal__actions {
        flex-direction: column;
    }

    .privacy-modal__button {
        width: 100%;
    }
}