/* KütüpLink - Giriş ve kayıt sayfaları
   Renkler logodan: lacivert #022a5d ve beyaz. */

:root {
    --navy: #022a5d;
    --navy-700: #0b3c7a;
    --navy-900: #011b3d;
    --navy-200: #a9c1e2;
    --ink: #0e2240;
    --muted: #586880;
    --line: #cfd9e6;
    --line-soft: #e4eaf3;
    --mist: #f2f5fa;
    --tint: #e7eef8;
    --paper: #ffffff;
    --danger: #a3302a;
    --danger-bg: #fdf2f1;
    --danger-line: #f1d0cc;
    --ok: #23613a;
    --ok-bg: #eef7f1;
    --ok-line: #cde5d5;
    --ring: 0 0 0 4px rgba(2, 42, 93, .13);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body.kl-auth {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

.kl-auth a { color: var(--navy); }
.kl-auth :focus-visible { outline: 3px solid #4f86cc; outline-offset: 3px; }
.kl-auth svg { display: block; }
.kl-sr {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

/* ---------- Yerleşim ---------- */

.kl-shell {
    display: grid;
    grid-template-columns: minmax(380px, 41%) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
}

/* ---------- Sol panel ---------- */

.kl-aside {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 36px 52px 30px;
    background: var(--navy);
    color: #fff;
    overflow: hidden;
    isolation: isolate;
}

.kl-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    align-self: flex-start;
    color: #fff !important;
    text-decoration: none;
    font-size: 23px;
    font-weight: 750;
    letter-spacing: -.02em;
}
.kl-brand:hover span { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1.5px; }

.kl-logo { width: 34px; height: auto; flex: none; color: var(--navy); --logo-cut: #fff; }
.kl-aside .kl-logo { color: #fff; --logo-cut: var(--navy); }
.kl-logo .c { fill: var(--logo-cut); }
.kl-logo .a { stroke: var(--logo-cut); }

.kl-aside-body {
    margin: auto 0;
    padding: 56px 0 64px;
    max-width: 440px;
}

.kl-aside h2 {
    margin: 0 0 20px;
    font-size: clamp(36px, 3.5vw, 54px);
    line-height: 1.04;
    letter-spacing: -.04em;
    font-weight: 780;
    text-wrap: balance;
}

.kl-aside-intro {
    margin: 0;
    max-width: 36ch;
    font-size: 16.5px;
    line-height: 1.6;
    color: #c6d5ea;
}

.kl-points {
    list-style: none;
    margin: 40px 0 0;
    padding: 26px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .16);
    display: grid;
    gap: 14px;
}
.kl-points li { display: flex; align-items: center; gap: 13px; font-size: 15px; color: #e9f0fa; }
.kl-points svg { width: 21px; height: 21px; flex: none; color: var(--navy-200); }

.kl-aside-foot { margin: 0; font-size: 12.5px; color: #8ea7c9; }

/* Logodaki sinyal, büyük ve silik: sayfanın tek "gösterişli" öğesi */
.kl-signal {
    position: absolute;
    right: -150px;
    bottom: -40px;
    width: 640px;
    height: auto;
    color: #fff;
    opacity: .085;
    z-index: -1;
    pointer-events: none;
}
.kl-signal path {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    animation: kl-draw 1s cubic-bezier(.2, .7, .2, 1) backwards;
}
.kl-signal circle { animation: kl-pop .5s ease-out backwards; }
.kl-signal path:nth-child(1) { animation-delay: .25s; }
.kl-signal path:nth-child(2) { animation-delay: .45s; }
.kl-signal path:nth-child(3) { animation-delay: .65s; }
.kl-signal path:nth-child(4) { animation-delay: .85s; }

@keyframes kl-draw { from { stroke-dashoffset: 1; } }
@keyframes kl-pop { from { opacity: 0; } }

/* ---------- Sağ panel ---------- */

.kl-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--paper);
}

.kl-main-top {
    display: flex;
    justify-content: flex-end;
    padding: 26px 40px 0;
}

.kl-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: -10px;
    padding: 7px 10px;
    border-radius: 8px;
    color: var(--muted) !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}
.kl-back svg { width: 17px; height: 17px; }
.kl-back:hover { color: var(--navy) !important; background: var(--mist); }

.kl-panel {
    width: 100%;
    max-width: 452px;
    margin: auto;
    padding: 32px 24px 56px;
}
.kl-auth--register .kl-panel { max-width: 620px; }

/* ---------- Sekmeler ---------- */

.kl-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin: 0 0 34px;
    border-radius: 12px;
    background: var(--mist);
}
.kl-tabs a {
    flex: 1;
    padding: 9px 12px;
    border-radius: 9px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
}
.kl-tabs a:hover { color: var(--navy); }
.kl-tabs a[aria-current="page"] {
    background: #fff;
    color: var(--navy);
    box-shadow: 0 1px 2px rgba(2, 42, 93, .1), 0 0 0 1px rgba(2, 42, 93, .05);
}

/* ---------- Başlık ---------- */

.kl-heading { margin: 0 0 28px; }
.kl-heading h1 {
    margin: 0 0 8px;
    font-size: 31px;
    line-height: 1.15;
    letter-spacing: -.03em;
    font-weight: 760;
    color: var(--ink);
}
.kl-heading p { margin: 0; font-size: 15px; color: var(--muted); }

/* ---------- Form alanları ---------- */

.kl-section { margin: 0 0 10px; padding: 0; border: 0; min-width: 0; }
.kl-section legend {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0 0 16px;
    padding: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
}
.kl-section legend::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.kl-section + .kl-section { margin-top: 8px; }

.kl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; }
.kl-span-2 { grid-column: 1 / -1; }

.kl-field { min-width: 0; margin: 0 0 18px; }

.kl-label {
    display: block;
    margin: 0 0 7px;
    font-size: 13.5px;
    font-weight: 650;
    color: var(--ink);
}
.kl-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 7px; }
.kl-label-row .kl-label { margin: 0; }
.kl-label-row a { font-size: 13.5px; font-weight: 600; text-decoration: none; }
.kl-label-row a:hover { text-decoration: underline; text-underline-offset: 3px; }

.kl-input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    transition: border-color .15s, box-shadow .15s;
}
.kl-input::placeholder { color: #8b98aa; opacity: 1; }
.kl-input:hover { border-color: #a7b8cf; }
.kl-input:focus { outline: none; border-color: var(--navy); box-shadow: var(--ring); }
.kl-input:disabled { background: var(--mist); color: #8b98aa; cursor: not-allowed; }
.kl-input[aria-invalid="true"] { border-color: var(--danger); }

select.kl-input {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23022a5d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    background-size: 16px;
    cursor: pointer;
}

.kl-password { position: relative; }
.kl-password .kl-input { padding-right: 50px; }
.kl-eye {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--muted);
    cursor: pointer;
}
.kl-eye:hover { color: var(--navy); background: var(--mist); }
.kl-eye svg { width: 20px; height: 20px; }
.kl-eye .slash { display: none; }
.kl-eye[aria-pressed="true"] .slash { display: inline; }

.kl-hint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.kl-hint:empty { display: none; }
.kl-hint.is-error { color: var(--danger); }
.kl-hint.is-ok { color: var(--ok); }

.kl-inline-error { margin: -6px 0 16px; font-size: 13.5px; color: var(--danger); }
.kl-link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--navy);
    font: inherit;
    font-weight: 650;
    text-decoration: underline;
    cursor: pointer;
}

/* ---------- Güvenlik kodu ---------- */

.kl-captcha {
    margin: 4px 0 20px;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--mist);
}
.kl-captcha .kl-label { margin-bottom: 10px; }
.kl-captcha-row { display: flex; align-items: center; gap: 8px; }
.kl-captcha-img {
    flex: none;
    width: 124px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}
.kl-icon-btn {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--navy);
    cursor: pointer;
}
.kl-icon-btn:hover { border-color: var(--navy); }
.kl-icon-btn:disabled { opacity: .5; cursor: wait; }
.kl-icon-btn svg { width: 19px; height: 19px; }
.kl-captcha-row .kl-input {
    flex: 1;
    min-width: 0;
    height: 46px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .28em;
    font-weight: 650;
}
.kl-captcha-row .kl-input::placeholder { text-transform: none; letter-spacing: normal; font-weight: 400; }

/* ---------- Onay kutusu ---------- */

.kl-consent {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0 0 22px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--muted);
}
.kl-consent input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--navy);
    cursor: pointer;
}
.kl-consent a { font-weight: 600; text-underline-offset: 2px; }

/* ---------- Düğme ---------- */

.kl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: var(--navy);
    color: #fff;
    font: inherit;
    font-size: 15.5px;
    font-weight: 650;
    cursor: pointer;
    transition: background-color .15s;
}
.kl-btn:hover { background: var(--navy-700); }
.kl-btn:active { background: var(--navy-900); }
.kl-btn:disabled { background: #93a3ba; cursor: not-allowed; }

.kl-spin {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: kl-spin .7s linear infinite;
}
@keyframes kl-spin { to { transform: rotate(360deg); } }

.kl-switch { margin: 22px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.kl-switch a { font-weight: 650; text-decoration: none; }
.kl-switch a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Uyarılar ---------- */

.kl-alert {
    display: flex;
    gap: 10px;
    margin: 0 0 24px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}
.kl-alert svg { flex: none; width: 19px; height: 19px; margin-top: 1px; }
.kl-alert p, .kl-alert ul { margin: 0; }
.kl-alert ul { padding: 0; list-style: none; }
.kl-alert li + li, .kl-alert p + p { margin-top: 4px; }
.kl-alert--error { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.kl-alert--ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.kl-alert-action { display: inline-block; margin-top: 6px; font-weight: 650; color: inherit !important; text-underline-offset: 3px; }

/* ---------- Kısa ekranlar (masaüstü) ---------- */

@media (min-width: 961px) and (max-height: 760px) {
    .kl-aside { padding-top: 28px; padding-bottom: 24px; }
    .kl-aside-body { padding: 32px 0; }
    .kl-aside h2 { font-size: clamp(32px, 3vw, 44px); }
    .kl-points { margin-top: 28px; padding-top: 20px; gap: 10px; }
    .kl-main-top { padding-top: 18px; }
    .kl-panel { padding-top: 16px; padding-bottom: 32px; }
    .kl-tabs { margin-bottom: 24px; }
    .kl-heading { margin-bottom: 22px; }
}

/* ---------- Tablet ve mobil ---------- */

@media (max-width: 960px) {
    .kl-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }

    .kl-aside {
        position: relative;
        height: auto;
        flex-direction: row;
        align-items: center;
        padding: 18px 24px;
    }
    .kl-aside-body, .kl-aside-foot { display: none; }
    .kl-brand { font-size: 21px; }
    .kl-logo { width: 30px; }
    .kl-signal { width: 260px; right: -60px; bottom: -120px; opacity: .12; }

    .kl-main-top { display: none; }
    .kl-panel { margin: 0 auto; padding: 28px 22px 44px; }
}

@media (max-width: 560px) {
    body.kl-auth { font-size: 15px; }
    .kl-panel { padding: 22px 18px 40px; }
    .kl-tabs { margin-bottom: 24px; }
    .kl-heading { margin-bottom: 22px; }
    .kl-heading h1 { font-size: 26px; }
    .kl-grid { grid-template-columns: minmax(0, 1fr); }
    .kl-input { font-size: 16px; } /* iOS odakta yakınlaştırmasın */
    .kl-captcha { padding: 12px; }
    .kl-captcha-row { flex-wrap: wrap; }
    .kl-captcha-img { flex: 1; width: auto; }
    .kl-captcha-row .kl-input { flex-basis: 100%; }
}

@media (max-width: 560px) and (min-width: 360px) {
    /* İl ve ilçe yan yana kalsın */
    .kl-auth--register .kl-section:nth-of-type(2) .kl-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    .kl-auth *, .kl-auth *::before, .kl-auth *::after {
        animation: none !important;
        transition: none !important;
    }
}
