.site-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.site-modal.is-open { display: flex; }

.site-modal__backdrop {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, #000 65%, transparent);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.site-modal__dialog {
    position: relative;
    z-index: 2;
    width: min(100%, 560px);
    max-height: calc(100vh - 40px);
    overflow: auto;
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    box-shadow: 0 32px 96px rgba(0, 0, 0, 0.5);
    /* Dinamik Y/X Boşluğu (Modallar için) */
    padding: var(--padding-y-desktop, 32px) var(--padding-x-desktop, 32px);
    transition: all var(--transition-smooth);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.site-modal__dialog--sm { width: min(100%, 460px); }
.site-modal__dialog--md { width: min(100%, 560px); }
.site-modal__dialog--lg { width: min(100%, 760px); }

.site-modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: var(--radius-button);
    background: var(--color-surface-2);
    color: var(--color-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition-fast);
}

.site-modal__close:hover {
    background: var(--color-surface-hover);
    color: var(--color-danger);
    transform: rotate(90deg);
}

.site-modal__title {
    margin: 0 0 8px;
    padding-right: 48px;
    /* Akışkan (Fluid) Modal Başlığı */
    font-size: clamp(1.4rem, 3vw, var(--h2-scale, 1.6rem));
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--color-text);
}

.site-modal__text {
    margin: 0 0 24px;
    color: var(--color-muted);
    font-size: 1rem;
}

.modal-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    background: var(--color-surface-2);
    padding: 6px;
    border-radius: var(--radius-input);
}

.modal-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 20px;
    border: none;
    border-radius: var(--radius-button);
    background: transparent;
    color: var(--color-muted);
    font-weight: 600;
    flex: 1 1 auto;
    transition: all var(--transition-fast);
}

.modal-tab:hover { color: var(--color-text); }

.modal-tab.is-active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.modal-panel { display: none; }
.modal-panel.is-active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-form { display: grid; gap: 16px; }
.modal-form label { margin: 0; }

.modal-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
    justify-content: center;
}

.modal-links a,
.modal-links button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--color-primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.modal-links a:hover,
.modal-links button:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.modal-profile-menu { display: grid; gap: 16px; }

.modal-profile-card {
    display: grid;
    gap: 4px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    background: var(--color-surface-2);
}

.modal-profile-card strong { font-size: 1.1rem; color: var(--color-text); }
.modal-profile-card span { color: var(--color-muted); word-break: break-word; font-size: 0.95rem; }

.modal-profile-actions { display: grid; gap: 10px; margin-top: 8px; }

.modal-profile-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-button);
    text-decoration: none;
    color: var(--color-text);
    font-weight: 600;
    background: var(--color-surface-2);
    padding: 0 16px;
    transition: all var(--transition-fast);
}

.modal-profile-actions a:hover {
    transform: translateY(-2px);
    background: var(--color-surface-hover);
    border-color: var(--border-color-strong);
}

.modal-profile-actions a.btn-primary {
    background: var(--color-primary);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 25%, transparent);
}

.modal-profile-actions a.btn-primary:hover { background: var(--color-primary-hover); }

/* =========================
   GENDER SELECTION CARDS (Modal İçin)
========================= */
.gender-selection-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.gender-radio-card {
    flex: 1;
    position: relative;
    cursor: pointer;
    margin: 0;
}

.gender-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.gender-radio-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 8px;
    background: var(--color-surface-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-input);
    color: var(--color-muted);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.gender-radio-content i {
    font-size: 1.1rem;
}

.gender-radio-card:hover .gender-radio-content {
    background: var(--color-surface-hover);
    border-color: var(--border-color-strong);
    color: var(--color-text);
}

.gender-radio-card input[type="radio"]:checked + .gender-radio-content {
    background: color-mix(in srgb, var(--color-primary) 10%, transparent);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.gender-radio-card input[type="radio"]:focus-visible + .gender-radio-content {
    outline: none;
    box-shadow: var(--shadow-focus);
}

body.modal-open { overflow: hidden; }

[data-theme="light"] .site-modal__dialog { box-shadow: 0 32px 96px color-mix(in srgb, var(--color-text) 15%, transparent); }
[data-theme="light"] .site-modal__close { background: var(--color-surface-2); }
[data-theme="light"] .site-modal__close:hover { background: color-mix(in srgb, var(--color-danger) 10%, var(--color-surface-hover)); }
[data-theme="light"] .modal-tabs { background: var(--color-surface-2); }
[data-theme="light"] .modal-tab:hover { color: var(--color-text); }

@media (max-width: 640px) {
    .site-modal { padding: 0; align-items: flex-end; }
    .site-modal__dialog, .site-modal__dialog--sm, .site-modal__dialog--md, .site-modal__dialog--lg {
        width: 100%; max-height: 90vh; border-bottom-left-radius: 0; border-bottom-right-radius: 0; 
        /* Dinamik Mobil Boşluk Eklendi */
        padding: var(--padding-y-mobile, 24px) var(--padding-x-mobile, 20px); 
        animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    @keyframes modalSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
    .site-modal__title { font-size: 1.4rem; }
    .modal-tab { min-height: 40px; padding: 0 12px; font-size: 0.95rem; }
    .modal-links { gap: 12px 16px; }
}