/* ==========================================================================
   PUAN HESAPLAMA (LGS / TYT / AYT) — public hesaplayıcı
   --------------------------------------------------------------------------
   ⚠ AİLE DOSYASI — 6 projede md5-BİREBİR. Tüm kurallar .ph* kapsamlıdır.
   Renkler projenin kendi token'larından TÜRETİLİR (zincir: simyakoleji --c-* →
   kurs üçlüsü/simyayayinlari --primary-dark/--primary-bg → goyayinlari --go-* →
   sabit yedek). Bir projede token yoksa zincir bir sonrakine düşer.
   ⚠ goyayinlari'da ana renk ALTINDIR: üstüne beyaz metin gelmez (--ph-ana-metin
     = --go-black). Diğer projelerde ana renk koyu tondur (beyaz metin ≥ 4,5:1).
   ⚠ --ph-vurgu-zemin: VURGU rengindeki METİN --ph-zemin (açık ton) üstüne
     geliyorsa bu kullanılır. --ph-vurgu'nun %12 koyulaştırılmışıdır; testteknik-
     akademi #C24E14 zemin #FDF0E8 üstünde 4,28:1 (AA altı) verdiği için eklendi
     (koyu ton 5,24:1; diğer 5 projede ≥ 7,6:1). color-mix desteklemeyen tarayıcı
     --ph-vurgu'ya düşer.
   ========================================================================== */

.ph,
.ph-bilgi,
.ph-sss,
.ph-diger {
    --ph-ana: var(--c-primary-dark, var(--primary-dark, var(--go-gold, #1e293b)));
    --ph-ana-metin: var(--go-black, #fff);
    --ph-vurgu: var(--c-primary-dark, var(--primary-dark, var(--go-black, #1e293b)));
    --ph-zemin: var(--c-light, var(--primary-bg, var(--go-bg-warm, #f7f8fa)));
    --ph-kenar: var(--c-gray-light, var(--gray-300, #e2e8f0));
    --ph-metin: var(--c-text, var(--dark, var(--go-charcoal, #1f2937)));
    --ph-soluk: var(--c-gray, var(--gray-600, var(--go-gray-light, #64748b)));
    --ph-hata: #b42318;
    --ph-radius: var(--radius, var(--go-radius, 14px));
    --ph-vurgu-zemin: var(--ph-vurgu);
    color: var(--ph-metin);
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
    .ph,
    .ph-bilgi,
    .ph-sss,
    .ph-diger {
        --ph-vurgu-zemin: color-mix(in srgb, var(--ph-vurgu) 88%, #000);
    }
}

.ph-gizli {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ---------------- Hesaplayıcı bölümü ---------------- */
.ph {
    padding: 2rem 0 2.5rem;
}
.ph-giris {
    max-width: 52rem;
    margin: 0 0 1.5rem;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--ph-soluk);
}
.ph-duzen {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}
@media (min-width: 992px) {
    .ph-duzen {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    }
    .ph-sonuc {
        position: sticky;
        top: 96px;
    }
}

.ph-form {
    background: #fff;
    border: 1px solid var(--ph-kenar);
    border-radius: var(--ph-radius);
    padding: 1.25rem;
    min-width: 0;
}
.ph-baslik {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--ph-metin);
}
.ph-baslik span,
.ph-bolum-baslik__metin span,
.ph-sonuc__baslik span {
    color: var(--ph-vurgu);
}
/* "Sonucu gör" — yalnız tek sütunda (<992 px) sonuç formdan sonra geldiği için. */
.ph-sonuca {
    margin: -.5rem 0 1rem;
}
.ph-sonuca__baglanti {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 44px;
    padding: .25rem 0;
    font-weight: 600;
    color: var(--ph-vurgu);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.ph-sonuca__baglanti:focus-visible {
    outline: 3px solid var(--ph-vurgu);
    outline-offset: 2px;
}
@media (min-width: 992px) {
    .ph-sonuca {
        display: none;
    }
}
.ph-sonuc {
    scroll-margin-top: 120px;
}
.ph-noscript {
    padding: .75rem 1rem;
    border-radius: 10px;
    background: #fff4e5;
    color: #7a3e00;
    font-weight: 600;
}

.ph-grup {
    border: 0;
    margin: 0 0 1.25rem;
    padding: 0;
    min-width: 0;
}
.ph-grup legend {
    float: none;
    width: auto;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 .5rem;
    padding: 0;
    color: var(--ph-vurgu);
}

.ph-satir {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) 4.5rem 4.5rem 4rem;
    grid-template-areas: "ad d y net" "hata hata hata hata";
    column-gap: .5rem;
    align-items: center;
    padding: .4rem 0;
    border-bottom: 1px solid var(--ph-kenar);
}
.ph-satir:last-child {
    border-bottom: 0;
}
.ph-satir--baslik {
    grid-template-areas: "ad d y net";
    padding: 0 0 .25rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ph-soluk);
}
.ph-satir--baslik span:not(:first-child) {
    text-align: center;
}
.ph-ad {
    grid-area: ad;
    font-weight: 600;
    line-height: 1.3;
    min-width: 0;
}
.ph-ad small {
    display: block;
    font-weight: 400;
    font-size: .8rem;
    color: var(--ph-soluk);
}
.ph-satir > input[id^="phD-"] { grid-area: d; }
.ph-satir > input[id^="phY-"] { grid-area: y; }
.ph-net {
    grid-area: net;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ph-vurgu);
}
.ph-hata {
    grid-area: hata;
    font-size: .85rem;
    color: var(--ph-hata);
    min-height: 0;
}
.ph-hata:empty {
    display: none;
}

.ph-alan {
    width: 100%;
    min-height: 44px;
    padding: .45rem .5rem;
    font-size: 16px;
    text-align: center;
    color: var(--ph-metin);
    background: #fff;
    border: 1px solid var(--ph-kenar);
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
}
.ph-alan::placeholder {
    color: var(--ph-soluk);
    opacity: 1;   /* Firefox varsayılan saydamlığını da kapatır (≥ 4,5:1) */
}
.ph-alan:focus-visible,
.ph-temizle:focus-visible,
.ph-onay input:focus-visible,
.ph-sss__oge summary:focus-visible,
.ph-diger__baglanti:focus-visible {
    outline: 3px solid var(--ph-vurgu);
    outline-offset: 2px;
}
.ph-alan[aria-invalid="true"] {
    border-color: var(--ph-hata);
    background: #fff5f4;
}
.ph-alan--genis {
    max-width: 9rem;
}

.ph-obp {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    margin-bottom: .6rem;
}
.ph-obp__etiket {
    font-weight: 600;
}
.ph-obp .ph-hata {
    flex: 1 1 100%;
}
.ph-onay {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
}
.ph-onay input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: .15rem;
    flex: 0 0 auto;
    accent-color: var(--ph-vurgu);
}
.ph-onay label {
    line-height: 1.4;
}

.ph-eylem {
    display: flex;
    justify-content: flex-end;
}
.ph-temizle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 44px;
    padding: .5rem 1rem;
    font-weight: 600;
    color: var(--ph-vurgu);
    background: transparent;
    border: 1px solid var(--ph-kenar);
    border-radius: 999px;
    cursor: pointer;
}
.ph-temizle:hover {
    background: var(--ph-zemin);
    color: var(--ph-vurgu-zemin);
}

/* ---------------- Sonuç kutusu ---------------- */
.ph-sonuc {
    min-width: 0;
}
.ph-sonuc__kutu {
    background: #fff;
    border: 1px solid var(--ph-kenar);
    border-radius: var(--ph-radius);
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
.ph-sonuc__baslik {
    margin: 0;
    padding: .85rem 1.1rem;
    font-size: 1.05rem;
    font-weight: 700;
    background: var(--ph-ana);
    color: var(--ph-ana-metin);
}
.ph-sonuc__baslik span {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.ph-sonuc__ana {
    padding: 1rem 1.1rem .5rem;
}
.ph-sonuc__etiket {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ph-soluk);
}
.ph-sonuc__deger {
    display: block;
    font-size: 2.25rem;
    line-height: 1.15;
    font-weight: 800;
    color: var(--ph-vurgu);
    font-variant-numeric: tabular-nums;
}
.ph-sonuc__liste {
    margin: 0;
    padding: .25rem 1.1rem 1rem;
}
.ph-sonuc__liste > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .45rem 0;
    border-bottom: 1px dashed var(--ph-kenar);
}
.ph-sonuc__liste > div:last-child {
    border-bottom: 0;
}
.ph-sonuc__liste dt {
    font-weight: 500;
    color: var(--ph-soluk);
}
.ph-sonuc__liste dd {
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.ph-sonuc__vurgu dt,
.ph-sonuc__vurgu dd {
    color: var(--ph-vurgu);
}
.ph-sonuc__tablo {
    width: calc(100% - 2.2rem);
    margin: .75rem 1.1rem .25rem;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}
.ph-sonuc__tablo th,
.ph-sonuc__tablo td {
    padding: .45rem .25rem;
    border-bottom: 1px solid var(--ph-kenar);
    text-align: right;
}
.ph-sonuc__tablo th:first-child {
    text-align: left;
}
.ph-sonuc__tablo thead th {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ph-soluk);
}
.ph-sonuc__tablo tbody th abbr {
    text-decoration: none;
    font-weight: 800;
    color: var(--ph-vurgu);
}
.ph-sonuc__tablo td {
    font-weight: 700;
}
.ph-yok {
    font-weight: 500;
    font-size: .85rem;
    color: var(--ph-soluk);
    cursor: help;
}
.ph-sonuc__not,
.ph-sonuc__hata {
    margin: 0 1.1rem 1rem;
    padding: .6rem .75rem;
    border-radius: 10px;
    font-size: .9rem;
    line-height: 1.45;
}
.ph-sonuc__not {
    background: var(--ph-zemin);
    color: var(--ph-metin);
}
.ph-sonuc__hata {
    background: #fff5f4;
    color: var(--ph-hata);
    font-weight: 600;
}
.ph-sonuc__not[hidden],
.ph-sonuc__hata[hidden] {
    display: none;
}
.ph-uyari {
    display: flex;
    gap: .5rem;
    margin: .85rem 0 0;
    font-size: .85rem;
    line-height: 1.5;
    color: var(--ph-soluk);
}
.ph-uyari i {
    margin-top: .2rem;
    color: var(--ph-vurgu);
}

/* ---------------- Nasıl hesaplanır? ---------------- */
.ph-bilgi,
.ph-sss {
    padding: 2.5rem 0;
}
.ph-bilgi {
    background: var(--ph-zemin);
}
.ph-bolum-baslik {
    text-align: center;
    margin: 0 auto 1.5rem;
    max-width: 46rem;
}
.ph-bolum-baslik__ust {
    display: inline-block;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ph-vurgu-zemin);
    margin-bottom: .35rem;
}
.ph-bolum-baslik__metin {
    margin: 0;
    font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--ph-metin);
}
.ph-bilgi__icerik {
    max-width: 52rem;
    margin: 0 auto;
}
.ph-metin p {
    line-height: 1.7;
    margin: 0 0 1rem;
}
.ph-formul {
    margin: 0 0 1.25rem;
    padding-left: 1.2rem;
    line-height: 1.7;
}
.ph-formul li {
    margin-bottom: .35rem;
}
.ph-tablo-kap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border: 1px solid var(--ph-kenar);
    border-radius: var(--ph-radius);
}
.ph-tablo {
    width: 100%;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}
.ph-tablo caption {
    caption-side: top;
    padding: .75rem 1rem 0;
    font-weight: 700;
    color: var(--ph-metin);
}
.ph-tablo th,
.ph-tablo td {
    padding: .55rem 1rem;
    border-bottom: 1px solid var(--ph-kenar);
    text-align: center;
}
.ph-tablo th[scope="row"],
.ph-tablo thead th:first-child {
    text-align: left;
}
.ph-tablo thead th {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ph-soluk);
}
.ph-tablo tbody tr:last-child th,
.ph-tablo tbody tr:last-child td {
    border-bottom: 0;
}
.ph-tablo__grup th {
    background: var(--ph-zemin);
    color: var(--ph-vurgu-zemin);
    font-weight: 700;
    text-align: left;
}

/* ---------------- SSS ---------------- */
.ph-sss__liste {
    max-width: 52rem;
    margin: 0 auto;
}
.ph-sss__oge {
    background: #fff;
    border: 1px solid var(--ph-kenar);
    border-radius: var(--ph-radius);
    margin-bottom: .75rem;
}
.ph-sss__oge summary {
    position: relative;
    list-style: none;
    padding: 1rem 3rem 1rem 1.1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--ph-radius);
}
.ph-sss__oge summary::-webkit-details-marker {
    display: none;
}
.ph-sss__oge summary::after {
    content: "+";
    position: absolute;
    right: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--ph-vurgu);
}
.ph-sss__oge[open] summary::after {
    content: "−";
}
.ph-sss__cevap {
    padding: 0 1.1rem 1rem;
    line-height: 1.7;
    color: var(--ph-metin);
}
.ph-sss__cevap p {
    margin: 0 0 .75rem;
}
.ph-sss__cevap p:last-child {
    margin-bottom: 0;
}

/* ---------------- Diğer araçlar ---------------- */
.ph-diger {
    padding: 0 0 2.5rem;
}
.ph-diger .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem;
}
.ph-diger__baslik {
    font-weight: 700;
}
.ph-diger__baglanti {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 44px;
    padding: .5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--ph-kenar);
    background: #fff;
    color: var(--ph-vurgu);
    font-weight: 600;
    text-decoration: none;
}
.ph-diger__baglanti:hover {
    background: var(--ph-zemin);
    color: var(--ph-vurgu-zemin);
}

/* ---------------- Küçük ekran ---------------- */
@media (max-width: 575.98px) {
    .ph-form {
        padding: 1rem .85rem;
    }
    .ph-sonuc__deger {
        font-size: 1.9rem;
    }
}
@media (max-width: 420px) {
    .ph-satir {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 3.75rem;
        grid-template-areas: "ad ad ad" "d y net" "hata hata hata";
        row-gap: .35rem;
    }
    /* Başlık satırı GİZLENMEZ: tek satırlık "Doğru · Yanlış · Net" olarak giriş
       sütunlarının üstünde kalır ("Test" sütunu ad satırına çıktığı için gizli). */
    .ph-satir--baslik {
        grid-template-areas: "d y net";
        padding: 0 0 .15rem;
    }
    .ph-satir--baslik span:first-child {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ph-sonuc {
        scroll-behavior: auto;
    }
    .ph * {
        transition: none !important;
        animation: none !important;
    }
}
