/*
Login screen stylesheet - loaded ONLY by templates/auth/views/login.gohtml
(which does not load static/css/app.css). Ported from the mockup
docs/makiety/logowanie.html + docs/makiety/assets/app.css, limited to the
rules this screen needs.

Everything is scoped under body.login-page (or login-/sheet-specific class
names) on purpose: the page still loads Bootstrap for the flash/toast partials, so
the mockup's global .btn/.btn-primary/.row/body rules were NOT copied as-is -
they would override Bootstrap. The modal buttons use .sheet-btn* instead, and
the "label + link" row uses .field-l-row instead of Bootstrap's .row.
*/

.login-page {
    --ink: #2d2a3e;
    --ink2: #4a4566;
    --ink3: #5d5880;
    --mut: #8b86a6;
    --lab: #8f89ad;
    --eyebrow: #9a94b5;
    --line: #ece9f7;
    --line3: #f0edf9;
    --soft: #faf9fe;
    --pri: #4e4680;
    --pri-h: #3e3769;
    --ok-bg: #dff1e8;
    --ok: #2f7d63;
    --bad-bg: #fbe1e1;
    --bad: #9c4040;

    margin: 0;
    background: #f4f3f9;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

.login-page a {
    color: #6c5ce7;
    text-decoration: none;
}

.login-page a:hover {
    color: #4e3fd0;
    text-decoration: underline;
}

.login-page .mono {
    font-family: 'JetBrains Mono', monospace;
}

@keyframes login-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes login-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes login-sheet-in { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes login-sheet-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes login-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes login-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-28px, 22px) scale(1.06); }
    66% { transform: translate(18px, -16px) scale(.96); }
}

/* ---- Page layout: form column + decorative aside ---- */

.login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    background:
        radial-gradient(1200px 600px at 8% -12%, #e4f0ff 0%, rgba(228, 240, 255, 0) 60%),
        radial-gradient(900px 500px at 98% 0%, #f1e9ff 0%, rgba(241, 233, 255, 0) 55%),
        #f4f3f9;
}

.login-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 44px 56px;
    min-width: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #c9bdf5, #a8e6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    color: #3a3357;
}

.brand-txt {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-name {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -.01em;
}

.brand-sub {
    font-size: 11px;
    color: var(--mut);
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* ---- Form ---- */

.login-form {
    max-width: 460px;
    width: 100%;
    margin: 40px auto;
}

.login-kicker {
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--eyebrow);
    font-weight: 600;
    margin-bottom: 10px;
}

.login-form h1 {
    margin: 0 0 10px;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.login-lead {
    margin: 0 0 28px;
    font-size: 15px;
    color: #7a7499;
    line-height: 1.5;
    text-wrap: pretty;
}

.fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 0;
}

.field-l {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--lab);
}

.field-l-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.field-l-row a {
    font-size: 12.5px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.input-lg {
    width: 100%;
    border: 1px solid #e9e6f4;
    background: #fff;
    border-radius: 14px;
    padding: 13px 16px;
    font: 400 14.5px/1.3 'Plus Jakarta Sans', sans-serif;
    color: var(--ink);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.input-lg:focus {
    border-color: #c3b7f2;
    box-shadow: 0 0 0 4px rgba(195, 183, 242, .28);
}

.pw {
    position: relative;
    display: block;
}

.pw .input-lg {
    padding-right: 82px;
}

.pw-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid #e9e6f4;
    background: var(--soft);
    border-radius: 10px;
    padding: 6px 11px;
    font: 700 12px/1.2 'Plus Jakarta Sans', sans-serif;
    color: var(--ink3);
    cursor: pointer;
}

.pw-toggle:hover {
    background: #f4f1ff;
    border-color: #d6cdf5;
}

.remember {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--ink2);
    cursor: pointer;
}

.chk {
    width: 15px;
    height: 15px;
    accent-color: var(--pri);
    cursor: pointer;
}

.notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bad-bg);
    border: 1px solid #f4cfcf;
    color: var(--bad);
    border-radius: 14px;
    padding: 11px 15px;
    font-size: 13.5px;
    font-weight: 600;
    animation: login-fade-in .18s ease-out;
}

.notice i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: block;
    flex: 0 0 auto;
}

.notice[hidden] {
    display: none;
}

.btn-login {
    border: none;
    background: var(--pri);
    color: #fff;
    border-radius: 14px;
    padding: 14px 20px;
    font: 700 15px/1.2 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    box-shadow: 0 16px 32px -16px rgba(78, 70, 128, .95);
    transition: background .15s, opacity .15s;
}

.btn-login:hover {
    background: var(--pri-h);
}

/* Wariant linku (ekran wygasłego linku logowania, auth/views/login_link.gohtml). */
a.btn-login {
    text-align: center;
    text-decoration: none;
}

/* Disabled while POST /api/login is in flight (static/js/login.js). */
.btn-login:disabled {
    opacity: .7;
    cursor: wait;
}

.login-foot {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--eyebrow);
}

/* ---- Decorative aside ---- */

.login-aside {
    position: relative;
    overflow: hidden;
    background: linear-gradient(150deg, #e5ddfb 0%, #dbe9fd 45%, #d6efe6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px;
    min-width: 0;
}

.blob {
    position: absolute;
    border-radius: 50%;
    display: block;
    /* Different duration/delay/direction per blob keeps the motion from looking synchronized. */
    animation: login-drift 22s ease-in-out infinite;
}

.blob-1 {
    width: 420px;
    height: 420px;
    background: rgba(255, 255, 255, .4);
    top: -120px;
    right: -110px;
}

.blob-2 {
    width: 280px;
    height: 280px;
    background: rgba(255, 226, 205, .55);
    bottom: -90px;
    left: -70px;
    animation-duration: 26s;
    animation-direction: reverse;
}

.blob-3 {
    width: 150px;
    height: 150px;
    background: rgba(196, 181, 253, .35);
    top: 18%;
    left: 10%;
    animation-duration: 18s;
    animation-delay: -6s;
}

.aside-inner {
    position: relative;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.aside-mark {
    width: 64px;
    height: 64px;
    border-radius: 22px;
    background: rgba(255, 255, 255, .85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    color: #3a3357;
    box-shadow: 0 26px 50px -30px rgba(45, 35, 95, .6);
    animation: login-float 7s ease-in-out infinite;
}

.aside-h {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.2;
    color: #2f2a4a;
    text-wrap: pretty;
}

.aside-p {
    font-size: 14.5px;
    color: #4f4a70;
    line-height: 1.55;
    text-wrap: pretty;
}

.aside-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, .7);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 18px;
    padding: 14px 16px;
}

.aside-note i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    display: block;
    margin-top: 6px;
    flex: 0 0 auto;
}

.aside-note span {
    font-size: 12.5px;
    color: #4f4a70;
    line-height: 1.5;
}

/* ---- "Nie pamiętam hasła" modal (UI-only placeholder, see login.gohtml) ---- */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(45, 38, 80, .42);
    backdrop-filter: blur(10px) saturate(.75);
    animation: login-fade-in .18s ease-out;
}

.overlay[hidden] {
    display: none;
}

.overlay.is-closing {
    animation: login-fade-out .2s ease-in forwards;
}

.sheet {
    display: block;
    width: min(520px, 92vw);
    background: rgba(255, 255, 255, .94);
    border: 1px solid var(--line);
    border-radius: 30px;
    padding: 32px 34px 34px;
    box-shadow: 0 50px 90px -40px rgba(45, 35, 95, .6);
    animation: login-sheet-in .26s cubic-bezier(.2, .9, .3, 1.1);
    max-height: calc(100vh - 48px);
    overflow: auto;
}

.overlay.is-closing .sheet {
    animation: login-sheet-out .2s ease-in forwards;
}

.sheet-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.sheet-kicker {
    font-size: 11px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--eyebrow);
    font-weight: 700;
}

.sheet-title {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -.02em;
}

.sheet-p {
    margin: 0;
    font-size: 14px;
    color: #7a7499;
    line-height: 1.55;
    text-wrap: pretty;
}

.sheet-p-sm {
    font-size: 13.5px;
}

.sheet-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
    flex-wrap: wrap;
}

.x-btn {
    border: 1px solid #e9e6f4;
    background: #fff;
    border-radius: 12px;
    width: 40px;
    height: 40px;
    font-size: 18px;
    color: #6b6590;
    cursor: pointer;
    line-height: 1;
    flex: 0 0 auto;
}

.x-btn:hover {
    background: #f4f1ff;
}

.sheet-btn {
    border: 1px solid #e4e0f2;
    background: #fff;
    color: var(--ink2);
    border-radius: 14px;
    padding: 11px 18px;
    font: 600 14px/1.2 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
}

.sheet-btn:hover {
    background: #f7f5ff;
}

.sheet-btn-primary {
    border: none;
    background: var(--pri);
    color: #fff;
    border-radius: 14px;
    padding: 11px 20px;
    font: 600 14px/1.2 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    box-shadow: 0 12px 26px -14px rgba(78, 70, 128, .9);
}

.sheet-btn-primary:hover {
    background: var(--pri-h);
}

.hint {
    background: var(--soft);
    border: 1px solid var(--line3);
    border-radius: 14px;
    padding: 11px 15px;
    font-size: 12.5px;
    color: #7a7499;
    line-height: 1.45;
}

.sent {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--ok-bg);
    border: 1px solid #cfe9dd;
    border-radius: 18px;
    padding: 16px 18px;
}

.sent i {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: var(--ok);
    flex: 0 0 auto;
    font-style: normal;
}

.sent .stack {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sent b {
    font-size: 14.5px;
    font-weight: 700;
    color: #24604c;
}

.sent span {
    font-size: 13px;
    color: #3d7a66;
    word-break: break-word;
}

/* ---- Responsive + reduced motion ---- */

@media screen and (max-width: 980px) {
    .login {
        grid-template-columns: 1fr;
    }

    .login-aside {
        order: -1;
        padding: 36px;
    }

    .login-left {
        padding: 32px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .blob,
    .aside-mark,
    .notice,
    .overlay,
    .overlay.is-closing,
    .sheet,
    .overlay.is-closing .sheet {
        animation: none;
    }
}

/* ---- Success toast before redirect (templates/partials/toast.gohtml) ----
   The shared partial/toast.js paint Bootstrap's .text-bg-success; here it is
   re-skinned to the mockup's green "sent" block. Scoped to .login-page so the
   toast behind the login keeps its current look. */

.login-page #app-toast {
    border-radius: 14px;
    border: 1px solid #cfe9dd !important;
    background: var(--ok-bg) !important;
    color: #24604c !important;
    font: 600 14px/1.4 'Plus Jakarta Sans', sans-serif;
    box-shadow: 0 26px 50px -30px rgba(45, 35, 95, .6);
}

.login-page #app-toast .toast-body {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}

/* ✓ badge echoing .sent i from the reset modal. */
.login-page #app-toast .toast-body::before {
    content: "\2713";
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: #fff;
    color: var(--ok);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex: 0 0 auto;
}

/* Light background, so the white close icon from the partial is inverted. */
.login-page #app-toast .btn-close-white {
    filter: none;
}
