/* ==========================================================================
   Yesilsoft Encryption — standalone stylesheet.
   No Bootstrap. The only JavaScript is wwwroot/js/site.js (clipboard + Enter).

   Plain document flow: the page scrolls if it has to. Text-area height comes
   from the single --box-height knob, which the height media queries at the
   bottom shrink on shorter screens so the result section usually lands
   without pushing the page into a scroll.
   ========================================================================== */

:root {
    /* Apple's own system-font stack: real SF Pro on macOS/iOS, Segoe UI Variable
       on Windows 11. Nothing is fetched from an external CDN. */
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
                 "Segoe UI Variable Display", "Segoe UI Variable Text", "Segoe UI",
                 Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;

    /* ----- tema -------------------------------------------------------------
       Her renk light-dark(açık, koyu) ile tek satırda tanımlı; hangi tarafın
       geçerli olacağını aşağıdaki color-scheme belirler. Paletin ikinci bir
       kopyasını ayrı bir medya sorgusunda tutmaya gerek kalmıyor.

       Buradaki "light dark", tercih belirtilmediğinde (data-theme="auto")
       tarayıcının/işletim sisteminin temasını takip et demek. Ayrıca kaydırma
       çubuğu ve yerleşik form kontrolleri gibi tarayıcının kendi çizdiği
       parçaları da temayla uyumlu hâle getirir.
       ---------------------------------------------------------------------- */
    color-scheme: light dark;

    --bg:            light-dark(#eef1f6, #10141b);
    --bg-accent:     light-dark(#e4e9f2, #161c25);
    --surface:       light-dark(#ffffff, #1a202b);
    --border:        light-dark(#d8dee9, #2a3341);
    --border-strong: light-dark(#c3ccdb, #3b4655);

    --text:       light-dark(#1c2330, #e7ecf3);
    --text-soft:  light-dark(#5a6577, #a6b2c2);
    --text-faint: light-dark(#8b95a6, #788494);

    --accent:            light-dark(#0f8a4f, #35c07d);
    --accent-hover:      light-dark(#0c7343, #4ad18e);
    --accent-ring:       light-dark(rgba(15, 138, 79, .22), rgba(53, 192, 125, .30));
    --accent-soft:       light-dark(#e8f5ee, #16281f);
    --accent-soft-hover: light-dark(#d7ecdf, #1d3528);
    /* Accent zemin üzerine gelen yazı. Koyu temada accent parlak bir yeşil
       olduğu için beyaz okunaklı değil; koyu bir yeşil kullanılıyor. */
    --on-accent:         light-dark(#ffffff, #06180f);

    --danger:        light-dark(#b3261e, #ff7b70);
    --danger-bg:     light-dark(#fdecea, #2b1512);
    --danger-border: light-dark(#f3c4c0, #5a221d);

    /* Hover'da yüzeyi hafifçe aydınlatan örtü — koyu temada beyaz bir katman
       neredeyse görünmez kalmalı, açıkta ise belirgin. */
    --hover-veil: light-dark(rgba(255, 255, 255, .65), rgba(255, 255, 255, .06));

    /* Gölge rengi ayrı bir değişken: light-dark() bir renk döndürür, bütün bir
       box-shadow listesini değil. */
    --shadow-tint:      light-dark(rgba(19, 26, 39, .07), rgba(0, 0, 0, .55));
    --shadow-tint-soft: light-dark(rgba(19, 26, 39, .05), rgba(0, 0, 0, .38));

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px var(--shadow-tint-soft), 0 8px 24px var(--shadow-tint);
    --shadow-soft: 0 1px 2px var(--shadow-tint-soft);

    /* Height of every text area — one knob, adjusted per viewport height. */
    --box-height: 8.5rem;
}

/* Kullanıcı tema düğmesiyle açık bir tercih belirttiyse tarayıcı ayarını ez.
   Değeri sunucu çerezden okuyup <html data-theme="..."> olarak basar. */
:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 17px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    letter-spacing: -.01em;
    color: var(--text);
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-accent) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ----- shell ------------------------------------------------------------ */

.content {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 1.5rem;
}

.footer {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: .95rem;
    color: var(--text-faint);
    border-top: 1px solid var(--border);
}

/* ----- tema seçici ------------------------------------------------------ */

/* Panellerin üstünde, sağa yaslı küçük bir hap. Düğmeler formun içinde gerçek
   submit butonları olduğu için JavaScript'e ihtiyaç yok. */
.themebar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .6rem;
    margin-bottom: 1.1rem;
}

.themebar__label {
    font-size: .9rem;
    color: var(--text-faint);
}

.switch {
    display: inline-flex;
    gap: .2rem;
    padding: .25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
}

.switch__btn {
    font-family: inherit;
    font-size: .87rem;
    font-weight: 500;
    letter-spacing: -.005em;
    color: var(--text-soft);
    background: none;
    border: none;
    border-radius: 999px;
    padding: .3rem .85rem;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.switch__btn:hover {
    color: var(--text);
    background: var(--hover-veil);
}

.switch__btn--on {
    color: var(--on-accent);
    background: var(--accent);
}

.switch__btn--on:hover {
    color: var(--on-accent);
    background: var(--accent-hover);
}

.switch__btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ----- panels ----------------------------------------------------------- */

.panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel__head {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.panel__mark {
    flex-shrink: 0;
    width: .45rem;
    height: 1.4rem;
    border-radius: 999px;
    background: var(--accent);
}

.panel__title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -.022em;
}

.panel__body {
    padding: 1.25rem 1.5rem 1.5rem;
}

/* ----- form ------------------------------------------------------------- */

.field + .field {
    margin-top: 1.1rem;
}

.field__label {
    display: block;
    margin-bottom: .4rem;
    font-size: .95rem;
    font-weight: 500;
    color: var(--text-soft);
}

/* Label row that carries a Kopyala/Yapıştır chip on the right. */
.field__head,
.result__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .4rem;
}

.field__head .field__label,
.result__head .result__label {
    margin-bottom: 0;
}

.input {
    display: block;
    width: 100%;
    height: var(--box-height);
    resize: vertical;
    font-family: inherit;
    font-size: 1.02rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: .7rem .95rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.input::placeholder {
    color: var(--text-faint);
}

.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-ring);
}

/* ----- segmented method picker ------------------------------------------ */

/* Radio inputs styled as a button group. The radios stay real form controls —
   keyboard arrows and screen readers keep working — they are just visually
   hidden, so no JavaScript is involved. */
.segmented {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .35rem;
    padding: .3rem;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
}

.segmented__input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    white-space: nowrap;
    clip-path: inset(50%);
}

.segmented__option {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: .95rem;
    font-weight: 500;
    color: var(--text-soft);
    border-radius: 7px;
    padding: .55rem .75rem;
    cursor: pointer;
    user-select: none;
    transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.segmented__option:hover {
    color: var(--text);
    background: var(--hover-veil);
}

.segmented__input:checked + .segmented__option {
    color: var(--on-accent);
    background: var(--accent);
    box-shadow: var(--shadow-soft);
}

.segmented__input:focus-visible + .segmented__option {
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 1.1rem;
    font-family: inherit;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--on-accent);
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    padding: .75rem 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: background-color .15s ease, transform .05s ease, box-shadow .15s ease;
}

.btn:hover {
    background: var(--accent-hover);
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--accent-ring);
}

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

/* ----- copy / paste chips ----------------------------------------------- */

.chip {
    flex-shrink: 0;
    font-family: inherit;
    font-size: .84rem;
    font-weight: 500;
    letter-spacing: -.005em;
    color: var(--accent);
    background: var(--accent-soft);
    border: none;
    border-radius: 999px;
    padding: .25rem .75rem;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.chip:hover {
    background: var(--accent-soft-hover);
}

.chip:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.chip--done {
    color: var(--on-accent);
    background: var(--accent);
}

/* ----- output ----------------------------------------------------------- */

.result {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px dashed var(--border);
}

.result__label {
    display: block;
    margin-bottom: .4rem;
    font-size: .95rem;
    font-weight: 600;
    color: var(--accent);
}

.result__value {
    display: block;
    width: 100%;
    height: var(--box-height);
    resize: vertical;
    font-family: inherit;
    font-size: 1.02rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--accent-soft);
    border: 1.5px solid transparent;
    border-radius: var(--radius-sm);
    padding: .7rem .95rem;
    word-break: break-all;
}

.result__value:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-ring);
}

.alert {
    margin-top: 1.1rem;
    font-size: .96rem;
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    border-left: 4px solid var(--danger);
    border-radius: var(--radius-sm);
    padding: .7rem 1rem;
}

/* ----- footnote --------------------------------------------------------- */

.note {
    max-width: 900px;
    margin: 1.5rem auto 0;
    font-size: .93rem;
    line-height: 1.55;
    color: var(--text-soft);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: .8rem 1.1rem;
    box-shadow: var(--shadow-soft);
}

.note strong {
    color: var(--text);
}

.note__hint {
    color: var(--text-faint);
}

kbd {
    font-family: inherit;
    font-size: .88em;
    font-weight: 500;
    color: var(--text-soft);
    background: var(--bg);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: .05rem .35rem;
}

/* ----- error page ------------------------------------------------------- */

.prose {
    max-width: 800px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem 2.25rem;
}

.prose h1 {
    margin-top: 0;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -.022em;
    color: var(--danger);
}

.prose code {
    font-family: inherit;
    background: var(--bg-accent);
    border-radius: 5px;
    padding: .15rem .4rem;
}

/* ==========================================================================
   Shorter screens — shrink the text areas and the chrome a little so the
   result section still tends to fit without scrolling.
   ========================================================================== */

@media (max-height: 950px) {
    :root {
        --box-height: 7rem;
    }
}

@media (max-height: 850px) {
    :root {
        --box-height: 6rem;
    }

    .content {
        padding-top: 1.5rem;
    }
}

@media (max-height: 750px) {
    html {
        font-size: 16px;
    }

    :root {
        --box-height: 5rem;
    }

    .content {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }

    .panel__head {
        padding-top: .8rem;
        padding-bottom: .8rem;
    }

    .footer {
        padding-top: .85rem;
        padding-bottom: .85rem;
    }
}

@media (max-height: 650px) {
    html {
        font-size: 15px;
    }

    :root {
        --box-height: 4.25rem;
    }
}

/* ==========================================================================
   Phones — single column, tighter chrome, comfortable tap targets.
   ========================================================================== */

@media (max-width: 560px) {
    html {
        font-size: 16px;
    }

    :root {
        --box-height: 6.5rem;
    }

    .content {
        padding: 1rem .85rem 1rem;
    }

    .panels {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .panel__head {
        padding: .85rem 1.1rem;
    }

    .panel__body {
        padding: 1.1rem 1.1rem 1.2rem;
    }

    .panel__title {
        font-size: 1.2rem;
    }

    .btn {
        padding: .85rem 1.5rem;
    }

    .chip {
        padding: .35rem .85rem;
    }

    .segmented__option {
        padding: .6rem .5rem;
    }

    .themebar {
        margin-bottom: .85rem;
    }

    .switch__btn {
        padding: .35rem .7rem;
    }
}

/* Narrowest phones: the two method labels no longer fit side by side. */
@media (max-width: 400px) {
    .segmented {
        grid-template-columns: 1fr;
    }
}
