/* ============================================
   利用規約同意トグル & モーダル
   ============================================ */
.terms-agreement {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.terms-label a {
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

/* Modal Content */
.modal-content {
    background-color: #fff;
    width: 100%;
    max-width: 600px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.close-modal-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    background: #fcfcfc;
}

/* Styles for imported terms content */
.modal-body .page-container {
    padding: 0 !important;
    max-width: none !important;
    background: transparent !important;
    min-height: auto !important;
}

.modal-body .page-header,
.modal-body .back-link,
.modal-body .footer-copy {
    display: none !important;
}

.modal-body h1.page-title {
    display: none !important;
}

.modal-body .content-section {
    margin-bottom: 24px;
}

.modal-body h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    padding-left: 10px;
    border-left: 3px solid var(--primary);
}

.modal-body ul {
    padding-left: 20px;
    margin-top: 4px;
}

.modal-body li {
    margin-bottom: 4px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    background: #fff;
    border-radius: 0 0 16px 16px;
    flex-shrink: 0;
}

.btn-agree-modal {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 99px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(91, 184, 212, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-agree-modal:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(91, 184, 212, 0.4);
}

.btn-agree-modal:active {
    transform: translateY(1px);
}