.legal-page-shell {
    --legal-shell-border: rgba(148, 163, 184, 0.2);
    --legal-shell-shadow: 0 28px 70px rgba(15, 23, 42, 0.08);
    --legal-shell-text: #23313b;
    --legal-shell-muted: #64748b;
}

/* Genişlik base_core.css'teki main > .page-shell > .container-xl kuralından
   gelir (--app-shell-max). Eski 1100px tanımı hiç uygulanmıyordu. */

.legal-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.25rem;
    padding: 1.6rem;
    border-radius: 28px;
    border: 1px solid var(--legal-shell-border);
    background:
        radial-gradient(circle at top right, rgba(79, 70, 229, 0.18), transparent 30%),
        radial-gradient(circle at left bottom, rgba(245, 158, 11, 0.12), transparent 24%),
        linear-gradient(145deg, #ffffff 0%, #f8fbff 56%, #eef4ff 100%);
    box-shadow: var(--legal-shell-shadow);
}

.legal-hero::after {
    content: "";
    position: absolute;
    inset: auto -7% -32% auto;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.14), transparent 68%);
    pointer-events: none;
}

.legal-hero__content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.legal-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.legal-hero__title {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.65rem;
    color: var(--legal-shell-text);
    font-size: clamp(1.6rem, 2.2vw, 2.25rem);
    font-weight: 800;
    letter-spacing: 0;
}

.legal-hero__mark {
    width: 3rem;
    height: 3rem;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: var(--shadow-soft, 0 12px 36px rgba(15, 23, 42, 0.03));
    flex-shrink: 0;
}

.legal-hero__mark img {
    width: 1.55rem;
    height: 1.55rem;
    object-fit: contain;
}

.legal-hero__subtitle {
    max-width: 700px;
    margin: 0;
    color: var(--legal-shell-muted);
    line-height: 1.68;
}

.legal-hero__meta {
    display: grid;
    gap: 0.75rem;
    width: min(100%, 320px);
}

.legal-meta-chip {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-height: 70px;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-soft, 0 12px 36px rgba(15, 23, 42, 0.03));
}

.legal-meta-chip__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.legal-meta-chip__value {
    color: var(--legal-shell-text);
    font-size: 1rem;
    font-weight: 700;
}

.legal-page-note {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 1rem 1.05rem;
    margin-bottom: 1rem;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(248, 250, 252, 0.92);
    color: #475569;
}

.legal-page-note i {
    margin-top: 0.15rem;
    color: #285d77;
}

.legal-article-card {
    border-radius: 28px;
    border: 1px solid var(--legal-shell-border);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-soft, 0 12px 36px rgba(15, 23, 42, 0.03));
}

.legal-article-card__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1.25rem 1.4rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.legal-article-card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    color: var(--legal-shell-text);
}

.legal-article-card__caption {
    margin: 0.2rem 0 0;
    color: #64748b;
    font-size: 0.88rem;
}

.legal-article-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 38px;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-2026-btn, 14px);
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: rgba(239, 246, 255, 0.92);
    color: #285d77;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.legal-content-body {
    padding: 1.4rem;
}

.legal-content-wrapper {
    color: var(--legal-shell-text);
}

.legal-content-wrapper a {
    color: #285d77;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.15em;
}

.legal-content-wrapper table {
    width: 100%;
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.legal-content-wrapper table td,
.legal-content-wrapper table th {
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    white-space: nowrap;
}

.legal-content-wrapper blockquote {
    margin: 1rem 0;
    padding: 0.9rem 1rem;
    border-left: 4px solid rgba(59, 130, 246, 0.42);
    background: rgba(239, 246, 255, 0.72);
    border-radius: 0 16px 16px 0;
}

/* [MVP 2026-08] "Çıkış Yap" kaldırıldıktan sonra satırda tek buton kaldı;
   space-between onu sola yapıştırıyordu. Birincil aksiyon sağda dursun. */
.legal-actions-row {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.legal-actions-row .btn {
    min-height: 46px;
    border-radius: var(--radius-2026-btn, 14px);
    padding-inline: 1.1rem;
    font-weight: 700;
}

.legal-consent-form {
    display: grid;
    gap: 1rem;
}

.legal-consent-list {
    display: grid;
    gap: 1rem;
}

.legal-consent-item {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: var(--shadow-soft, 0 12px 36px rgba(15, 23, 42, 0.03));
    overflow: hidden;
}

.legal-consent-item__head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.1rem 1.2rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.legal-consent-item__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.legal-consent-item__title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--legal-shell-text);
}

.legal-consent-item__meta {
    display: grid;
    gap: 0.4rem;
    justify-items: end;
}

.legal-consent-scroll {
    padding: 1rem 1.2rem 0;
}

/* [MVP 2026-08] Onay metni kutusu.
   Önce 340px'di; her metin ~8 satırlık pencereden okunuyordu ve sayfa
   kaydırması ile kutu kaydırması iç içe geçiyordu. 560px'e çıkarıldı,
   kaydırma sayısı belirgin düştü.
   NOT: Kutunun zemini bu dosyanın altındaki bir `!important` kuralından
   geliyor (#f8fcff), buradan kaldırılamaz — bilerek zorlanmadı. Metin
   kenarlara yapışmasın diye iç boşluk 15px. */
.legal-consent-text-box {
    max-height: 560px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 15px;
    box-shadow: none;
}

/* Kaydırılabilir olduğunun sezilmesi için ince bir ayraç. */
.legal-consent-scroll {
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    margin-top: 0.25rem;
}

/* Sayfanın tek amacı onay vermek; birincil buton küçük kalmasın. */
.legal-action-btn--primary {
    min-height: 46px;
    font-weight: 600;
}

/* Üç meta kutusunun yerini alan tek satır. */
.legal-hero__count {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.75rem 0 0;
    color: var(--legal-shell-text, #1f2937);
    font-size: 0.95rem;
}

.legal-consent-text-box table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
    font-size: 0.92em;
}

.legal-consent-text-box th,
.legal-consent-text-box td {
    padding: 0.5rem 0.65rem;
    border: 1px solid #d7ecf3;
    text-align: left;
    vertical-align: top;
}

.legal-consent-text-box thead th {
    background: #e8f4fb;
}

/* [MVP 2026-08] Onay kutusu ile etiketi birbirine yapışıktı.
   Sebep: buradaki `padding` kısayolu Bootstrap'in `.form-check`
   `padding-left: 1.5em` değerini eziyordu; input ise hâlâ `margin-left: -1.5em`
   ile sola çekiliyordu. Sol boşluk ve negatif marj artık açıkça eşleştirildi. */
.legal-consent-check {
    margin: 1rem 1.2rem 1.2rem;
    padding: 0.95rem 1rem 0.95rem 3rem;
    border-radius: 18px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: rgba(239, 246, 255, 0.82);
}

.legal-consent-check .form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    margin-top: 0.15rem;
    margin-left: -2rem;
}

.legal-consent-check .form-check-label {
    font-size: 0.94rem;
    font-weight: 700;
    color: #23313b;
    line-height: 1.6;
}

.legal-empty-state {
    padding: 1.4rem;
    border-radius: 20px;
    border: 1px dashed rgba(148, 163, 184, 0.28);
    background: rgba(248, 250, 252, 0.82);
    color: #64748b;
}

@media (max-width: 991px) {
    .legal-hero__content {
        display: grid;
        grid-template-columns: 1fr;
    }

    .legal-hero__meta {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .legal-hero {
        padding: 1.25rem;
        border-radius: 24px;
    }

    .legal-hero__title {
        gap: 0.7rem;
        font-size: 1.42rem;
    }

    .legal-hero__mark {
        width: 2.55rem;
        height: 2.55rem;
        border-radius: 15px;
    }

    .legal-hero__meta {
        grid-template-columns: 1fr;
    }

    .legal-article-card__header,
    .legal-content-body,
    .legal-consent-item__head,
    .legal-consent-scroll {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .legal-article-card__header,
    .legal-consent-item__head {
        display: grid;
        grid-template-columns: 1fr;
    }

    .legal-consent-item__meta {
        justify-items: start;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .legal-consent-check {
        margin: 1rem;
    }

    .legal-actions-row {
        display: grid;
        grid-template-columns: 1fr;
    }

    .legal-actions-row .btn,
    .legal-actions-row a {
        width: 100%;
        text-align: center;
    }
}

/* Production polish: flat legal surfaces */
.legal-hero,
.legal-meta-chip,
.legal-page-note,
.legal-article-card,
.legal-article-card__badge,
.legal-consent-item,
.legal-consent-text-box,
.legal-consent-check,
.legal-empty-state,
.legal-actions-row .btn,
.legal-action-btn {
    border-radius: 8px;
}

.legal-hero {
    background: #fff;
}

.legal-hero::after {
    content: none;
}

.legal-hero__eyebrow,
.legal-meta-chip__label,
.legal-consent-item__eyebrow {
    letter-spacing: 0;
}

.legal-hero__title,
.legal-article-card__title {
    letter-spacing: 0;
}

.legal-actions-row .btn,
.legal-action-btn {
    min-height: 44px;
    font-size: 0.9rem;
}

.legal-page-shell--compact .legal-hero {
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.legal-page-shell--compact .legal-hero__title {
    font-size: clamp(1.1rem, 1.5vw, 1.35rem) !important;
    font-weight: 600;
}

.legal-page-shell--compact .legal-hero__mark {
    width: 2rem;
    height: 2rem;
}

.legal-page-shell--compact .legal-hero__mark img {
    width: 1rem;
    height: 1rem;
}

.legal-page-shell--compact .legal-hero__eyebrow {
    font-size: 0.7rem;
}

.legal-page-shell--compact .legal-hero__subtitle {
    max-width: 500px;
    font-size: 0.85rem;
}

.legal-page-shell--compact .legal-meta-chip {
    min-height: auto;
    padding: 0.6rem 0.85rem;
}

.legal-page-shell--compact .legal-meta-chip__label {
    font-size: 0.65rem;
}

.legal-page-shell--compact .legal-meta-chip__value {
    font-size: 0.85rem;
    font-weight: 600;
}

.legal-page-shell--compact .legal-article-card__header,
.legal-page-shell--compact .legal-content-body {
    padding: 1rem 1.25rem;
}

.legal-page-shell--compact .legal-article-card__title {
    font-size: 0.95rem;
}

.legal-page-shell--compact .legal-article-card__caption {
    font-size: 0.8rem;
}

.legal-page-shell--compact .legal-article-card__badge {
    min-height: auto;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
}

.legal-page-shell--compact .legal-consent-text-box {
    max-height: 280px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.legal-page-shell--compact .legal-consent-item__title {
    font-size: 1rem;
}

.legal-page-shell--compact .legal-content-wrapper {
    font-size: 0.95rem;
    line-height: 1.7;
}

.legal-page-shell--compact .legal-content-wrapper h1,
.legal-page-shell--compact .legal-content-wrapper h2,
.legal-page-shell--compact .legal-content-wrapper h3,
.legal-page-shell--compact .legal-content-wrapper h4 {
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.legal-page-shell--compact .legal-content-wrapper p,
.legal-page-shell--compact .legal-content-wrapper ul,
.legal-page-shell--compact .legal-content-wrapper ol {
    margin-bottom: 0.85rem;
}

.legal-page-shell--compact .legal-content-wrapper ul,
.legal-page-shell--compact .legal-content-wrapper ol {
    padding-left: 1.25rem;
}

.legal-page-shell--compact .legal-content-wrapper li {
    margin-bottom: 0.4rem;
}

.legal-page-shell--compact .legal-actions-row {
    margin-top: 0.75rem;
}

/* Production visual polish: legal pages light/pastel pass */
.legal-page-shell {
    --legal-shell-border: #d7ecf3;
    --legal-shell-shadow: 0 8px 22px rgba(24, 52, 69, 0.07);
    --legal-shell-text: #183445;
    --legal-shell-muted: #5f7480;
    background: #f8fcff;
    color: var(--legal-shell-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.legal-page-shell h1,
.legal-page-shell h2,
.legal-page-shell h3,
.legal-page-shell h4,
.legal-page-shell h5,
.legal-page-shell h6,
.legal-page-shell strong {
    color: var(--legal-shell-text);
    letter-spacing: 0;
}

.legal-page-shell .text-muted,
.legal-page-shell small,
.legal-page-shell .small,
.legal-article-card__caption,
.legal-hero__subtitle,
.legal-meta-chip__label,
.legal-consent-item__eyebrow {
    color: var(--legal-shell-muted) !important;
}

.legal-hero,
.legal-meta-chip,
.legal-page-note,
.legal-article-card,
.legal-consent-item,
.legal-consent-text-box,
.legal-consent-check,
.legal-empty-state,
.legal-page-shell .card,
.legal-page-shell .list-group-item {
    background: #ffffff !important;
    border: 1px solid var(--legal-shell-border) !important;
    border-radius: 8px !important;
    box-shadow: var(--legal-shell-shadow) !important;
}

.legal-page-note,
.legal-consent-text-box,
.legal-page-shell .card-header,
.legal-page-shell .card-footer {
    background: #f8fcff !important;
}

.legal-hero__mark,
.legal-article-card__badge,
.legal-page-shell .badge,
.legal-page-shell .bg-primary-subtle,
.legal-consent-check {
    background: #e8f4fb !important;
    border: 1px solid #b9dce7 !important;
    color: #285d77 !important;
}

.legal-content-wrapper,
.legal-content-wrapper p,
.legal-content-wrapper li,
.legal-content-wrapper td,
.legal-content-wrapper th {
    color: var(--legal-shell-text);
}

.legal-content-wrapper a,
.legal-page-note i,
.legal-page-shell .text-primary {
    color: #285d77 !important;
}

.legal-content-wrapper table td,
.legal-content-wrapper table th {
    border-color: #d7ecf3;
}

.legal-content-wrapper blockquote {
    background: #f8fcff;
    border-left-color: #9acada;
    border-radius: 8px;
}

.legal-actions-row .btn,
.legal-action-btn,
.legal-page-shell .btn {
    border-radius: 8px !important;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.legal-page-shell .btn-primary,
.legal-actions-row .btn-primary {
    background: #e8f4fb !important;
    border: 1px solid #b9dce7 !important;
    color: #285d77 !important;
    box-shadow: none !important;
}

.legal-page-shell .btn-outline-secondary,
.legal-actions-row .btn-outline-secondary {
    background: #ffffff !important;
    border-color: #d7ecf3 !important;
    color: #5f7480 !important;
}

.legal-page-shell .btn-danger {
    background: #fae9e9 !important;
    border-color: #e9b9bc !important;
    color: #8f3439 !important;
}

.legal-page-shell .form-control,
.legal-page-shell .form-select,
.legal-page-shell textarea,
.legal-page-shell input {
    background: #ffffff;
    border-color: #cfe1eb;
    border-radius: 8px;
    color: var(--legal-shell-text);
}

.legal-page-shell .form-control:focus,
.legal-page-shell .form-select:focus,
.legal-page-shell textarea:focus,
.legal-page-shell input:focus {
    border-color: #9acada;
    box-shadow: 0 0 0 3px rgba(77, 147, 166, 0.12);
}

.legal-consent-check .form-check-label {
    color: var(--legal-shell-text);
}

.legal-page-shell hr {
    border-color: #d7ecf3;
    opacity: 1;
}

.legal-page-shell .list-group-numbered .list-group-item {
    padding: 1rem;
}

/* Mandatory consent must stay reachable on notched devices and while mobile
   browser chrome changes the visible height. The base layout's fixed pixel
   gutters do not include safe-area insets, so this page extends them instead
   of replacing the established desktop rhythm. */
.legal-page-shell.page-shell {
    box-sizing: border-box;
    min-height: calc(100vh - 64px);
    min-height: calc(100svh - var(--identity-navbar-height, calc(64px + env(safe-area-inset-top, 0px))));
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    overflow-wrap: anywhere;
}

main > .legal-page-shell > .container-xl {
    padding-right: calc(10% + env(safe-area-inset-right, 0px)) !important;
    padding-left: calc(10% + env(safe-area-inset-left, 0px)) !important;
}

@supports (min-height: 100dvh) {
    .legal-page-shell.page-shell {
        min-height: calc(100dvh - var(--identity-navbar-height, calc(64px + env(safe-area-inset-top, 0px))));
    }
}

html.visual-viewport-supported .legal-page-shell.page-shell {
    min-height: calc(var(--visual-viewport-height, 100vh) - var(--identity-navbar-height, calc(64px + env(safe-area-inset-top, 0px))));
}

@media (max-width: 1199.98px) {
    main > .legal-page-shell > .container-xl {
        padding-right: calc(16px + env(safe-area-inset-right, 0px)) !important;
        padding-left: calc(16px + env(safe-area-inset-left, 0px)) !important;
    }
}

@media (max-width: 767.98px) {
    .legal-page-shell.page-shell {
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    }

    main > .legal-page-shell > .container-xl {
        padding-right: calc(12px + env(safe-area-inset-right, 0px)) !important;
        padding-left: calc(12px + env(safe-area-inset-left, 0px)) !important;
    }

    .legal-page-shell .legal-consent-item,
    .legal-page-shell .legal-consent-text-box,
    .legal-page-shell .legal-consent-check {
        min-width: 0;
        max-width: 100%;
    }

    .legal-page-shell .legal-consent-text-box,
    .legal-page-shell .legal-consent-text-box :is(p, li, a, strong) {
        overflow-wrap: anywhere;
    }
}
