/* Sign-in family (login / register / forgot / reset) — Oct 2026 redesign from the "Birewer Sign-in
   Redesign" canvas. Rendered bare (MainLayout.IsBare), so nothing from the Cuba shell or the paper
   book is on the page. Three layouts from one DOM (AuthFrame.razor):
     ≥1000px  desktop: two-panel card, brand panel at inline-start, form panel at inline-end
     600–999  iPad / narrow: one stacked card (brand band above the form), language pills in the band
     <600     phone app: edge-to-edge brand band, the form sheet slides over it (rounded top)
   Colours are the theme.css tokens; the few literals here are tints of them. */

.krd-auth {
    min-height: 100dvh; box-sizing: border-box; display: flex; align-items: center; justify-content: center;
    padding: 40px 16px; background: var(--bg, #f4eedd); color: var(--ink, #3b2c1c);
    font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
}
.krd-auth-shell {
    width: 100%; max-width: 1040px; min-height: 640px; display: flex; flex-wrap: wrap; border-radius: 28px; overflow: hidden;
    background: var(--card, #fffdf6); box-shadow: 0 32px 64px -24px rgba(67, 48, 31, .38), 0 0 0 1px rgba(67, 48, 31, .06);
}

/* ---- brand panel ---- */
.krd-auth-brand {
    flex: 1 1 400px; position: relative; overflow: hidden; background: var(--brand-dark, #43301f); color: #fbf4e4;
    padding: 56px 52px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; box-sizing: border-box;
}
.krd-auth-motif { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.krd-auth-brand > :not(.krd-auth-motif) { position: relative; }
.krd-auth-brand-top { display: flex; flex-direction: column; gap: 26px; }
.krd-auth-logo {
    width: 112px; height: 112px; border-radius: 26px; display: block; flex: 0 0 auto;
    box-shadow: 0 0 0 4px rgba(201, 162, 75, .6), 0 24px 40px -18px rgba(0, 0, 0, .7);
}
.krd-auth-brand-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.krd-auth-name { margin: 0; font-size: 46px; font-weight: 900; line-height: 1.15; color: #fbf4e4; }
.krd-auth-tagline { margin: 0; font-size: 17px; line-height: 1.65; color: rgba(251, 244, 228, .78); max-width: 32ch; }
.krd-auth-brand-foot { display: flex; flex-direction: column; gap: 18px; }
.krd-auth-rule { width: 56px; height: 3px; border-radius: 2px; background: var(--accent, #c9a24b); display: block; }
.krd-auth-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.krd-auth-chips li {
    display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px 0 14px; border-radius: 999px;
    border: 1px solid rgba(251, 244, 228, .18); background: rgba(251, 244, 228, .06); font-size: 15px; font-weight: 600; color: #fbf4e4;
}
.krd-auth-chips i { color: #e3c572; font-size: 15px; width: 18px; text-align: center; }

/* ---- language pills (two copies; CSS shows one) ---- */
.krd-auth-langs { display: flex; justify-content: flex-end; gap: 4px; }
.krd-auth-langs a {
    min-height: 44px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; font-weight: 700; text-decoration: none;
    border: 1px solid transparent; display: inline-flex; align-items: center; transition: background .15s, color .15s;
}
.krd-auth-langs.in-form { margin-bottom: 36px; }
.krd-auth-langs.in-form a { color: #7b6753; }
.krd-auth-langs.in-form a:hover { background: #f1e9d8; color: var(--ink, #3b2c1c); }
.krd-auth-langs.in-form a.on { background: #f1e9d8; color: var(--ink, #3b2c1c); border-color: #eadfc8; }
.krd-auth-langs.in-brand { display: none; }
.krd-auth-langs.in-brand a { min-height: 40px; padding: 0 12px; font-size: 13px; color: rgba(251, 244, 228, .78); }
.krd-auth-langs.in-brand a:hover { background: rgba(251, 244, 228, .1); color: #fbf4e4; }
.krd-auth-langs.in-brand a.on { background: rgba(251, 244, 228, .14); color: #fbf4e4; border-color: rgba(251, 244, 228, .22); }
.krd-auth-langs a:focus-visible { outline: 3px solid var(--accent, #c9a24b); outline-offset: 2px; }

/* ---- form panel ---- */
.krd-auth-form {
    flex: 1 1 420px; padding: 36px 56px 44px; display: flex; flex-direction: column; box-sizing: border-box;
    background: var(--card, #fffdf6); position: relative; z-index: 1;
}
.krd-auth-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 26px; }
.krd-auth-title { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.2; color: var(--ink, #3b2c1c); }
.krd-auth-title:focus { outline: none; }
.krd-auth-sub { margin: 0; font-size: 15.5px; line-height: 1.6; color: #7b6753; }

.krd-auth-alert {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin-bottom: 20px;
    background: #fbe9e7; border: 1px solid #f1c3bd; color: #a93226; font-size: 14px; font-weight: 600; line-height: 1.5;
}
.krd-auth-alert i { flex: 0 0 auto; margin-top: 3px; }
.krd-auth-alert.ok { background: #e9f3e6; border-color: #c4dfbd; color: #2f6b2a; }

.krd-auth-fields { display: flex; flex-direction: column; gap: 18px; }
.krd-auth-field { display: flex; flex-direction: column; gap: 8px; }
.krd-auth-field label { font-size: 14px; font-weight: 700; color: var(--ink, #3b2c1c); margin: 0; }
.krd-auth-label-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.krd-auth-ctl { position: relative; }
.krd-auth-ctl > i {
    position: absolute; inset-inline-start: 17px; top: 50%; transform: translateY(-50%); color: #9c876f; font-size: 16px;
    pointer-events: none; transition: color .15s;
}
.krd-auth-ctl input {
    width: 100%; box-sizing: border-box; height: 54px; border-radius: 16px; border: 1.5px solid #eadfc8; background: var(--card, #fffdf6);
    padding: 0 16px; padding-inline-start: 48px; margin: 0; font: inherit; font-size: 16px; color: var(--ink, #3b2c1c); text-align: start;
    outline: none; box-shadow: none; transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.krd-auth-ctl input.has-eye { padding-inline-end: 56px; }
.krd-auth-ctl input::placeholder { color: #857058; opacity: 1; }
.krd-auth-ctl input:focus { border-color: var(--accent, #c9a24b); box-shadow: 0 0 0 4px rgba(201, 162, 75, .28); }
.krd-auth-ctl:focus-within > i { color: var(--brand, #6b4a2b); }
.krd-auth-ctl input.invalid { border-color: #d9534f; }
.krd-auth-eye {
    position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 12px;
    border: 0; background: transparent; color: #7b6753; display: grid; place-items: center; cursor: pointer; padding: 0; font-size: 16px;
}
.krd-auth-eye:hover { background: #f1e9d8; color: var(--ink, #3b2c1c); }
.krd-auth-eye:focus-visible { outline: 3px solid var(--accent, #c9a24b); outline-offset: 2px; }
.krd-auth .validation-message { color: #a93226; font-size: 13px; font-weight: 600; }
.krd-auth .validation-message:empty { display: none; }

.krd-auth-go {
    margin-top: 6px; width: 100%; min-height: 56px; border-radius: 16px; border: 0; background: var(--brand-dark, #43301f); color: #fbf4e4;
    font: inherit; font-size: 17px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
    box-shadow: 0 14px 28px -14px rgba(67, 48, 31, .65); text-decoration: none; box-sizing: border-box; transition: background .15s;
}
.krd-auth-go:hover { background: var(--brand, #6b4a2b); color: #fbf4e4; }
.krd-auth-go:active { transform: translateY(1px); }
.krd-auth-go:focus-visible { outline: 3px solid var(--accent, #c9a24b); outline-offset: 3px; }
html[dir="rtl"] .krd-auth-go .fa-arrow-right { transform: scaleX(-1); }

.krd-auth-link { color: var(--brand, #6b4a2b); font-weight: 700; text-decoration: none; font-size: 13.5px; }
.krd-auth-link:hover { text-decoration: underline; color: var(--brand-dark, #43301f); }
.krd-auth-foot { margin-top: auto; padding-top: 32px; display: flex; flex-direction: column; gap: 16px; }
.krd-auth-hr { height: 1px; background: #eadfc8; }
.krd-auth-foot p { margin: 0; font-size: 15px; color: #7b6753; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.krd-auth-foot .krd-auth-link { font-size: 15px; font-weight: 800; min-height: 44px; display: inline-flex; align-items: center; }

/* ---- iPad portrait / narrow desktop: one stacked card ---- */
@media (max-width: 999px) {
    .krd-auth { padding: 48px 32px; }
    .krd-auth-shell { max-width: 620px; min-height: 0; flex-direction: column; flex-wrap: nowrap; border-radius: 30px; }
    .krd-auth-brand { flex: 0 0 auto; padding: 28px 48px 40px; gap: 26px; }
    .krd-auth-langs.in-brand { display: flex; }
    .krd-auth-langs.in-form { display: none; }
    .krd-auth-brand-top { flex-direction: row; align-items: center; gap: 22px; }
    .krd-auth-logo { width: 96px; height: 96px; border-radius: 24px; }
    .krd-auth-name { font-size: 40px; line-height: 1.1; }
    .krd-auth-tagline { font-size: 16px; line-height: 1.55; }
    .krd-auth-rule { display: none; }
    .krd-auth-ring { r: 190; } .krd-auth-disc { r: 118; }
    .krd-auth-form { flex: 0 0 auto; padding: 40px 48px; }
    .krd-auth-foot { padding-top: 28px; }
    .krd-auth-foot p { justify-content: center; }
}

/* ---- phone app: edge-to-edge band + sheet ---- */
@media (max-width: 599px) {
    .krd-auth { padding: 0; align-items: stretch; }
    .krd-auth-shell { max-width: none; min-height: 100dvh; border-radius: 0; box-shadow: none; background: transparent; }
    .krd-auth-brand { padding: calc(env(safe-area-inset-top, 0px) + 16px) 24px 60px; gap: 22px; }
    .krd-auth-brand-top { gap: 16px; }
    .krd-auth-logo { width: 80px; height: 80px; border-radius: 20px; box-shadow: 0 0 0 3px rgba(201, 162, 75, .6), 0 18px 30px -14px rgba(0, 0, 0, .7); }
    .krd-auth-name { font-size: 32px; }
    .krd-auth-tagline { font-size: 13.5px; line-height: 1.5; }
    .krd-auth-brand-foot { display: none; }
    .krd-auth-ring { r: 150; } .krd-auth-disc { r: 92; }
    .krd-auth-form {
        flex: 1 1 auto; margin-top: -28px; border-radius: 28px 28px 0 0;
        padding: 28px 24px calc(env(safe-area-inset-bottom, 0px) + 28px); box-shadow: 0 -14px 34px -22px rgba(67, 48, 31, .55);
    }
    .krd-auth-head { gap: 6px; margin-bottom: 22px; }
    .krd-auth-title { font-size: 25px; }
    .krd-auth-sub { font-size: 14.5px; }
    .krd-auth-fields { gap: 16px; }
    .krd-auth-foot { padding-top: 24px; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .krd-auth-go, .krd-auth-ctl input, .krd-auth-ctl > i, .krd-auth-langs a { transition: none; }
}
