/* Redesigned login page (FEATURE_FLAG_CONTELIZER_UI) - templates/bundles/FOSUserBundle/contelizer/Security/login.html.twig */
:root {
    color-scheme: light;
    --bg: #EEF2F0;
    --surface: #FFFFFF;
    --fg: #1C2320;
    --muted: #5B6662;
    --line: #DFE6E3;
    --field: #F3F6F4;
    --accent: #23855F;
    --accent-hover: #1C6E4F;
    --accent-soft: #E3F2EB;
    --accent-ink: #FFFFFF;
    --panel: #E6ECE9;
    --bad: #B4321F;
    --bad-soft: #FBE4DF;
    --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
    --body: "Figtree", "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #0B0F0D;
        --surface: #18201D;
        --fg: #E8EEEB;
        --muted: #9AA6A1;
        --line: #2A3531;
        --field: #111614;
        --accent: #4CC493;
        --accent-hover: #63D3A4;
        --accent-soft: #1B3329;
        --accent-ink: #0D1A14;
        --panel: #141B18;
        --bad: #FF8A73;
        --bad-soft: #3A1D17;
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 15px/1.5 var(--body);
    display: grid;
    place-items: center;
    padding: 24px 16px;
}

h1,
h2 {
    font-family: var(--display);
    font-weight: 650;
    letter-spacing: -0.02em;
    margin: 0;
    text-wrap: balance;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

[hidden] {
    display: none !important;
}

.cz-login {
    width: min(1400px, 100%);
    min-height: min(820px, calc(100vh - 48px));
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: var(--surface);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(28, 35, 32, .06), 0 24px 60px rgba(28, 35, 32, .10);
}

/* Left panel */
.cz-login__panel {
    background: var(--panel);
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 44px 48px 48px;
    min-width: 0;
}

.cz-login__logo {
    height: 30px;
    width: auto;
    display: block;
    align-self: flex-start;
}

.cz-login__logo--dark {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .cz-login__logo--light {
        display: none;
    }

    .cz-login__logo--dark {
        display: block;
    }
}

.cz-login__models {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    align-items: end;
    min-height: 0;
}

.cz-login__models figure {
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 480 / 690;
    position: relative;
}

.cz-login__models figure:nth-child(2) {
    transform: translateY(-28px);
}

.cz-login__models img {
    width: calc(100% + 4px);
    height: 100%;
    margin-left: -2px;
    object-fit: cover;
    display: block;
}

.cz-login__models figcaption {
    position: absolute;
    left: 10px;
    bottom: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, .88);
    color: #1C2320;
    padding: 3px 8px;
    border-radius: 999px;
}

.cz-login__claim h2,
.cz-login__banner h2 {
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1.08;
}

.cz-login__claim h2 em,
.cz-login__banner h2 em {
    font-style: normal;
    color: var(--accent);
}

.cz-login__claim p {
    margin: 10px 0 0;
    color: var(--muted);
    max-width: 46ch;
}

/* Right panel */
.cz-login__form-side {
    display: flex;
    flex-direction: column;
    padding: 32px 40px;
    min-width: 0;
}

.cz-login__top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.cz-login__logo--mobile {
    display: none !important;
    margin-right: auto;
}

.cz-login__external {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 9px 14px;
}

.cz-login__external:hover {
    border-color: var(--accent);
}

.cz-login__center {
    flex: 1;
    display: grid;
    place-items: center;
    padding-block: 32px;
}

.cz-login__fields {
    width: min(400px, 100%);
    display: grid;
    gap: 18px;
}

.cz-login__fields h1 {
    font-size: 34px;
    line-height: 1.1;
}

.cz-login__subtitle {
    margin: 6px 0 4px;
    color: var(--muted);
}

.cz-login label,
#reset_password_form label p {
    font-weight: 600;
    font-size: 14px;
    display: block;
    margin: 0 0 6px;
}

.cz-login input[type=text],
.cz-login input[type=password],
.cz-login input[type=email] {
    width: 100%;
    font: 16px var(--body);
    color: var(--fg);
    background: var(--field);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 13px 14px;
}

.cz-login input::placeholder {
    color: var(--muted);
    opacity: .8;
}

.cz-login input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.cz-login input[aria-invalid=true] {
    border-color: var(--bad);
    background: var(--surface);
}

.cz-login__password {
    position: relative;
}

.cz-login__password input {
    padding-right: 48px !important;
}

.cz-login__reveal {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
}

.cz-login__reveal svg {
    width: 20px;
    height: 20px;
    display: block;
}

.cz-login__row {
    display: flex;
    justify-content: flex-end;
    font-size: 14px;
}

.cz-login__link {
    color: var(--accent);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.cz-login__back {
    justify-self: center;
    font-size: 14px;
}

.cz-login__submit,
#reset_password_form button[type=submit] {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 14px 18px;
    font: 600 16px var(--body);
    color: var(--accent-ink);
    background: var(--accent);
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: background .15s ease;
}

.cz-login__submit:hover,
#reset_password_form button[type=submit]:hover {
    background: var(--accent-hover);
}

#reset_password_form button[type=submit]:disabled {
    opacity: .6;
}

#reset_password_form {
    display: grid;
    gap: 18px;
}

#reset_password_form > div,
#reset_password_form label {
    margin: 0 !important;
}

.cz-login__error {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--bad-soft);
    color: var(--bad);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
}

.cz-login__error svg {
    flex: none;
    margin-top: 1px;
}

.cz-login__error strong {
    display: block;
    color: var(--fg);
}

.cz-login__error span {
    color: var(--muted);
}

#alert_msg:empty {
    display: none;
}

#alert_msg.cz-login__ok,
#alert_msg.cz-login__error-text {
    margin: 0;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
}

#alert_msg.cz-login__ok {
    background: var(--accent-soft);
    color: var(--fg);
}

#alert_msg.cz-login__error-text {
    background: var(--bad-soft);
    color: var(--bad);
}

.cz-login__info {
    display: flex;
    gap: 10px;
    background: var(--accent-soft);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
}

.cz-login__info svg {
    flex: none;
    width: 20px;
    height: 20px;
    color: var(--accent);
    margin-top: 1px;
}

.cz-login__footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
}

.cz-login__banner {
    display: none;
}

/* Phone */
@media (max-width: 900px) {
    body {
        padding: 0;
        place-items: stretch;
    }

    .cz-login {
        grid-template-columns: 1fr;
        border-radius: 0;
        min-height: 100vh;
        box-shadow: none;
    }

    .cz-login__panel {
        display: none;
    }

    .cz-login__form-side {
        padding: max(20px, env(safe-area-inset-top, 0px)) 20px max(20px, env(safe-area-inset-bottom, 0px));
    }

    .cz-login__logo--mobile.cz-login__logo--light {
        display: block !important;
        height: 24px;
    }

    .cz-login__center {
        place-items: start center;
        padding-top: 24px;
    }

    .cz-login__banner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 104px;
        align-items: stretch;
        gap: 14px;
        margin-top: 18px;
        background: var(--panel);
        border-radius: 16px;
        overflow: hidden;
        padding-left: 16px;
    }

    .cz-login__banner > div {
        align-self: center;
        padding-block: 16px;
        min-width: 0;
    }

    .cz-login__banner h2 {
        font-size: 22px;
        line-height: 1.12;
    }

    .cz-login__banner p {
        margin: 6px 0 0;
        font-size: 13px;
        line-height: 1.4;
        color: var(--muted);
    }

    .cz-login__banner figure {
        margin: 0;
        height: 150px;
    }

    .cz-login__banner img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center 15%;
        display: block;
    }

    .cz-login__fields h1 {
        font-size: 30px;
    }
}

@media (max-width: 900px) and (prefers-color-scheme: dark) {
    .cz-login__logo--mobile.cz-login__logo--light {
        display: none !important;
    }

    .cz-login__logo--mobile.cz-login__logo--dark {
        display: block !important;
        height: 24px;
    }
}

/* AI try-on loop: garment alone -> violet AI scan line runs from left to right and uncovers the photo on a model -> hold ->
   back to the garment. 7 s per cycle, the three photos start at different moments. Colours from contelizer.pl
   (AI = violet). */
.cz-login__tryon {
    --ai: #6D4AFF;
    position: relative;
    background: #FFFFFF;
}

.cz-login__tryon img {
    position: absolute;
    inset: 0;
}

.cz-login__tryon-before {
    object-fit: cover;
}

.cz-login__tryon-after {
    clip-path: inset(0 100% 0 0);
    animation: cz-tryon-reveal 7s cubic-bezier(.6, 0, .3, 1) infinite;
}

.cz-login__tryon-scan {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: var(--ai);
    box-shadow: 0 0 16px 3px var(--ai);
    opacity: 0;
    animation: cz-tryon-scan 7s cubic-bezier(.6, 0, .3, 1) infinite;
    pointer-events: none;
}

.cz-login__tryon figcaption {
    z-index: 1;
}

.cz-login__tryon-ai {
    color: var(--ai);
    opacity: 0;
    animation: cz-tryon-ai 7s linear infinite;
}

.cz-login__models .cz-login__tryon:nth-child(2) > * {
    animation-delay: -2.3s;
}

.cz-login__models .cz-login__tryon:nth-child(3) > *,
.cz-login__models .cz-login__tryon:nth-child(3) figcaption > * {
    animation-delay: -4.6s;
}

.cz-login__models .cz-login__tryon:nth-child(2) figcaption > * {
    animation-delay: -2.3s;
}

@keyframes cz-tryon-reveal {
    0%, 22% { clip-path: inset(0 100% 0 0); }
    46%, 86% { clip-path: inset(0 0 0 0); }
    96%, 100% { clip-path: inset(0 100% 0 0); }
}

@keyframes cz-tryon-scan {
    0%, 21% { left: 0; opacity: 0; }
    23% { left: 0; opacity: 1; }
    46% { left: calc(100% - 3px); opacity: 1; }
    49%, 100% { left: calc(100% - 3px); opacity: 0; }
}

@keyframes cz-tryon-ai {
    0%, 44% { opacity: 0; }
    48%, 86% { opacity: 1; }
    92%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cz-login__submit {
        transition: none;
    }

    /* no motion: just the photo on a model */
    .cz-login__tryon-after {
        animation: none;
        clip-path: none;
    }

    .cz-login__tryon-scan,
    .cz-login__tryon-ai {
        display: none;
    }
}
