/*
 * PersonaX giriş ekranı
 *
 * Neden statik dosya (Vite değil): public/build git'te değil ve deploy.sh build almıyor;
 * giriş ekranı her ortamda ilk açılan sayfa olduğu için build'e bağlı olmamalı.
 * Neden "pxl-" öneki: layouts.authentication.master temanın app.scss'ini de yüklüyor;
 * .card, .form-control gibi ortak sınıf adları temanın kurallarıyla çakışırdı.
 * Renkler logodan: petrol mavisi + turuncu (chatbot widget'ıyla aynı palet).
 */
.pxl {
    --pxl-teal-deep: #0f3447;
    --pxl-teal: #1d5d7c;
    --pxl-teal-light: #2a7597;
    --pxl-orange: #e8592b;
    --pxl-orange-hover: #d14b1f;
    --pxl-paper: #f4f7f8;
    --pxl-card: #ffffff;
    --pxl-ink: #17262e;
    --pxl-ink-soft: #5a6b74;
    --pxl-line: #d5e0e5;
    --pxl-error: #b42318;
    --pxl-error-bg: #fef3f2;
    --pxl-ok: #146c43;
    --pxl-ok-bg: #edf8f1;
    --pxl-warn-ink: #8a5300;
    --pxl-warn-bg: #fff7e6;
    --pxl-display: "Nunito", "Avenir Next Rounded", "Segoe UI", sans-serif;
    --pxl-body: "Roboto", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
    background: var(--pxl-paper);
    color: var(--pxl-ink);
    font-family: var(--pxl-body);
    font-size: 15px;
    line-height: 1.5;
}
.pxl *, .pxl *::before, .pxl *::after { box-sizing: border-box; }
/* Tema paragraf/link/etiketlere harf aralığı ekliyor; giriş ekranında metin seyrek görünüyordu */
.pxl p, .pxl a, .pxl label, .pxl span, .pxl h1, .pxl button { letter-spacing: normal; }
.pxl :focus-visible { outline: 3px solid var(--pxl-orange); outline-offset: 2px; }

/* ---------- Marka paneli ---------- */
.pxl-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 34px;
    padding: 48px 40px;
    text-align: center;
    color: #fff;
    background:
        radial-gradient(120% 90% at 15% 10%, var(--pxl-teal-light) 0%, transparent 55%),
        linear-gradient(160deg, var(--pxl-teal) 0%, var(--pxl-teal-deep) 75%);
}

/* Amblem: tam görünen mizaç (enneagram) dairesi; ortasında beyaz rozet içinde logo */
.pxl-emblem { position: relative; width: min(84%, 470px); aspect-ratio: 1; max-width: 100%; }
.pxl-emblem svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pxl-ring { fill: none; stroke: rgba(255, 255, 255, .32); stroke-width: 1.6; }
.pxl-line { fill: none; stroke: rgba(255, 255, 255, .2); stroke-width: 1.4; stroke-linejoin: round; }
.pxl-dot { fill: #fff; }
.pxl-dot.is-top { fill: var(--pxl-orange); }
.pxl-num { fill: rgba(255, 255, 255, .72); font: 700 14px var(--pxl-display); text-anchor: middle; dominant-baseline: central; }
.pxl-dot, .pxl-num { transform-box: fill-box; transform-origin: center; }

/* Logo beyaz zeminli olduğu için beyaz rozete kenar/renk bozulmadan oturur */
.pxl-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 54%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #fff;
    overflow: hidden;
    display: grid;
    place-items: center;
    box-shadow: 0 24px 50px -16px rgba(0, 0, 0, .55), 0 0 0 10px rgba(255, 255, 255, .07);
}
.pxl-badge img { width: 74%; height: auto; display: block; }

.pxl-slogan {
    margin: 0;
    font-family: var(--pxl-display);
    font-weight: 800;
    font-size: clamp(28px, 2.7vw, 40px);
    line-height: 1.1;
    text-wrap: balance;
    color: #fff;
}
.pxl-slogan em { font-style: normal; color: #ffb08f; }

/* Açılış (bir kez): daire → iç çizgiler → numaralar → rozet → logo → slogan */
.pxl-draw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.pxl-ring.pxl-draw { animation: pxl-draw 1.1s cubic-bezier(.6, 0, .3, 1) both; }
.pxl-line.pxl-draw { animation: pxl-draw 1.2s .35s cubic-bezier(.6, 0, .3, 1) both; }
.pxl-dot, .pxl-num { animation: pxl-pop .4s both; animation-delay: calc(.45s + var(--i) * .06s); }
.pxl-badge { animation: pxl-badge .7s 1.15s cubic-bezier(.3, 1.5, .5, 1) both; }
.pxl-badge img { animation: pxl-reveal .8s 1.45s cubic-bezier(.5, 0, .2, 1) both; }
.pxl-slogan { animation: pxl-fade-up .6s 1.7s ease-out both; }
.pxl-card { animation: pxl-rise .6s .15s cubic-bezier(.2, 1, .3, 1) both; }
@keyframes pxl-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pxl-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes pxl-badge {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.2); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes pxl-reveal { from { clip-path: circle(0% at 50% 45%); } to { clip-path: circle(75% at 50% 45%); } }
@keyframes pxl-fade-up { from { opacity: .2; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pxl-rise { from { opacity: .3; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Form tarafı ---------- */
.pxl-side { display: flex; flex-direction: column; padding: 32px 24px 24px; }
.pxl-side-main { flex: 1; display: grid; place-items: center; }
.pxl-card {
    width: 100%;
    max-width: 420px;
    display: grid;
    gap: 22px;
    padding: 36px 32px 30px;
    background: var(--pxl-card);
    border-radius: 20px;
    box-shadow: 0 24px 60px -32px rgba(15, 52, 71, .45), 0 0 0 1px rgba(15, 52, 71, .05);
}
.pxl-card h1 {
    margin: 0;
    font-family: var(--pxl-display);
    font-weight: 800;
    font-size: 28px;
    line-height: 1.15;
    color: var(--pxl-ink);
    text-wrap: balance;
}
.pxl-lead { margin: 6px 0 0; color: var(--pxl-ink-soft); font-size: 14.5px; }

.pxl-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #f7cfca;
    background: var(--pxl-error-bg);
    color: var(--pxl-error);
    font-size: 14px;
    line-height: 1.45;
}
.pxl-alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.pxl-alert.is-lock { background: var(--pxl-warn-bg); color: var(--pxl-warn-ink); border-color: #f5dcaa; }
.pxl-alert.is-ok { background: var(--pxl-ok-bg); color: var(--pxl-ok); border-color: #bfe3cc; }
.pxl-alert[hidden] { display: none; }
.pxl-alert b { font-variant-numeric: tabular-nums; }

.pxl-form { display: grid; gap: 16px; margin: 0; }
.pxl-field { display: grid; gap: 6px; }
.pxl-field > label { margin: 0; font-size: 13.5px; font-weight: 500; color: var(--pxl-ink); }
.pxl-control {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid var(--pxl-line);
    border-radius: 12px;
    background: #fbfcfd;
    transition: border-color .15s, box-shadow .15s;
}
.pxl-control:focus-within { border-color: var(--pxl-teal); box-shadow: 0 0 0 4px rgba(29, 93, 124, .12); background: #fff; }
.pxl-control.has-error { border-color: var(--pxl-error); box-shadow: 0 0 0 4px rgba(180, 35, 24, .08); }
.pxl-control input {
    flex: 1;
    min-width: 0;
    height: 48px;
    margin: 0;
    padding: 13px 14px;
    border: 0;
    border-radius: 12px;
    outline: 0;
    box-shadow: none;
    background: transparent;
    font: inherit;
    font-size: 15px;
    color: var(--pxl-ink);
}
.pxl-control input:focus,
.pxl-control input:focus-visible { outline: none; box-shadow: none; }
.pxl-control input::placeholder { color: #9aa9b1; }
.pxl-eye {
    width: 44px;
    height: 44px;
    margin-right: 2px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--pxl-ink-soft);
    cursor: pointer;
    display: grid;
    place-items: center;
}
.pxl-eye:hover { color: var(--pxl-teal); }
.pxl-eye svg { width: 20px; height: 20px; }
.pxl-hint { font-size: 13px; }
.pxl-hint.is-error { color: var(--pxl-error); }
.pxl-hint.is-caps { color: var(--pxl-warn-ink); display: flex; align-items: center; gap: 6px; }
.pxl-hint[hidden] { display: none; }

/* Captcha: resim + yenile butonu yan yana, altında kod alanı */
.pxl-captcha { display: flex; align-items: center; gap: 8px; }
.pxl-captcha img { flex: 1; min-width: 0; height: 44px; object-fit: contain; border-radius: 10px; border: 1px solid var(--pxl-line); background: #fff; }
.pxl-captcha button {
    flex: none;
    width: 44px;
    height: 44px;
    border: 1.5px solid var(--pxl-line);
    border-radius: 10px;
    background: #fff;
    color: var(--pxl-teal);
    cursor: pointer;
    display: grid;
    place-items: center;
}
.pxl-captcha button svg { width: 18px; height: 18px; }

.pxl-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.pxl-check { display: flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; color: var(--pxl-ink-soft); }
.pxl-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--pxl-teal); }
.pxl a { color: var(--pxl-teal); font-weight: 500; text-decoration: none; }
.pxl a:hover { text-decoration: underline; }

.pxl-submit {
    height: 50px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--pxl-orange);
    color: #fff;
    font: 600 16px var(--pxl-body);
    box-shadow: 0 10px 22px -12px rgba(232, 89, 43, .8);
    transition: background .15s, transform .15s, opacity .15s;
}
.pxl-submit:hover { background: var(--pxl-orange-hover); }
.pxl-submit:active { transform: translateY(1px); }
.pxl-submit:disabled { cursor: not-allowed; opacity: .6; box-shadow: none; }
.pxl-submit .pxl-arrow { width: 18px; height: 18px; transition: transform .2s; }
.pxl-submit:hover:not(:disabled) .pxl-arrow { transform: translateX(3px); }
.pxl-spin {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    animation: pxl-spin .7s linear infinite;
}
@keyframes pxl-spin { to { transform: rotate(360deg); } }

.pxl-help { margin: 0; font-size: 13px; color: var(--pxl-ink-soft); text-align: center; text-wrap: balance; }

/* Canlı şifre kuralları: yazdıkça sağlanan madde yeşil tike döner */
.pxl-rules {
    list-style: none;
    margin: 0;
    padding: 12px 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
    border-radius: 12px;
    background: var(--pxl-paper);
    font-size: 13px;
    color: var(--pxl-ink-soft);
}
.pxl-rules li { display: flex; align-items: center; gap: 7px; margin: 0; transition: color .2s; }
.pxl-rules li::before {
    content: "";
    flex: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid #b8c6cd;
    background: #fff center / 10px no-repeat;
    transition: background-color .2s, border-color .2s;
}
.pxl-rules li.is-ok { color: var(--pxl-ok); }
.pxl-rules li.is-ok::before {
    border-color: var(--pxl-ok);
    background-color: var(--pxl-ok);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E");
}
@media (max-width: 400px) { .pxl-rules { grid-template-columns: 1fr; } }

/* Kart altı ikincil eylem: "Giriş ekranına dön", "Çıkış yap" */
.pxl-back {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--pxl-ink-soft) !important;
    font: 500 14px var(--pxl-body);
    cursor: pointer;
}
.pxl-back:hover { color: var(--pxl-teal) !important; background: var(--pxl-paper); text-decoration: none !important; }
.pxl-back svg { width: 16px; height: 16px; }
.pxl-logout { margin: 0; display: grid; }
.pxl-foot { padding-top: 18px; font-size: 12.5px; color: var(--pxl-ink-soft); text-align: center; }

/* ---------- Telefon / dar ekran: marka paneli üstte şerit ---------- */
@media (max-width: 880px) {
    .pxl { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .pxl-brand { padding: 26px 20px 40px; gap: 16px; }
    .pxl-emblem { width: 200px; }
    .pxl-num { font-size: 19px; }
    .pxl-slogan { font-size: 22px; }
    .pxl-side { padding: 0 16px 16px; }
    .pxl-side-main { place-items: start center; }
    .pxl-card { position: relative; z-index: 2; margin-top: -14px; padding: 28px 22px 24px; }
}

/* Hatalı girişten dönüşte (.is-quiet) açılış tekrar oynamaz: her denemede 2 sn animasyon izlemek yorucu */
.pxl.is-quiet *, .pxl.is-quiet *::before, .pxl.is-quiet *::after { animation: none !important; }
.pxl.is-quiet .pxl-spin { animation: pxl-spin .7s linear infinite !important; }

/* Hareket hassasiyeti: animasyonlar kapanır, her şey son haliyle görünür */
@media (prefers-reduced-motion: reduce) {
    .pxl *, .pxl *::before, .pxl *::after { animation: none !important; transition-duration: .01ms !important; }
}
