/* Login page styles (loaded after common.css and landing.css, which supply the palette,
   buttons, .hero-pill, .accent-brand, .benefit-icon tints and the .pro-laptop dashboard) */

.login-page {
    min-height: 100vh;
    background: #ffffff;
}

.login-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- Left: brand showcase ---------- */
.login-showcase {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 56px clamp(32px, 5vw, 80px);
    background:
        radial-gradient(ellipse 50% 45% at 80% 20%, rgba(123, 63, 247, 0.16) 0%, transparent 70%),
        radial-gradient(ellipse 40% 40% at 0% 100%, rgba(60, 24, 245, 0.08) 0%, transparent 70%),
        linear-gradient(180deg, #f3f1ff 0%, #f8f7ff 60%, #ffffff 100%);
}

/* dotted route arc, as on the landing hero */
.login-showcase::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -160px;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    border: 2px dashed rgba(90, 43, 247, 0.12);
    pointer-events: none;
}

.login-showcase-inner {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.login-showcase h2 {
    margin-top: 22px;
    font-size: clamp(2rem, 3.2vw, 3rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.5px;
    color: var(--ink);
}

.login-showcase-sub {
    margin-top: 14px;
    max-width: 46ch;
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
}

.login-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px;
    margin-top: 26px;
    max-width: 520px;
}

.login-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}

.login-features .benefit-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.login-features .benefit-icon svg {
    width: 22px;
    height: 22px;
}

/* laptop dashboard + truck */
.login-visual {
    position: relative;
    margin-top: 40px;
    padding-left: 16%;
}

.login-truck {
    position: absolute;
    left: -2%;
    bottom: 22px;
    width: 40%;
    height: auto;
    -webkit-mask-image:
        linear-gradient(90deg, transparent 0%, #000 25%),
        linear-gradient(180deg, transparent 0%, #000 22%, #000 85%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(90deg, transparent 0%, #000 25%),
        linear-gradient(180deg, transparent 0%, #000 22%, #000 85%, transparent 100%);
    mask-composite: intersect;
}

.login-laptop {
    transform: none;
}

/* ---------- Right: form ---------- */
.login-form-side {
    display: flex;
    flex-direction: column;
    padding: 28px clamp(24px, 4vw, 64px);
    background: #ffffff;
}

.login-top {
    display: flex;
    justify-content: flex-end;
}

.login-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.login-back:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.login-back svg {
    width: 16px;
    height: 16px;
}

.login-card {
    width: 100%;
    max-width: 440px;
    margin: auto;
    padding: 32px 0;
}

.login-logo {
    display: block;
    width: auto;
    height: 52px;
    margin-bottom: 34px;
}

.login-eyebrow {
    font-size: 13px;
    font-weight: 600;
}

.login-card h1 {
    margin-top: 12px;
    font-size: clamp(2rem, 3vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--ink);
    margin-bottom: 12px;
}

.login-desc {
    margin: 8px 0 28px;
    font-size: 15.5px;
    color: var(--text);
}

/* alerts */
.login-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 22px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.login-alert svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.login-alert-ok {
    background: #ecfdf3;
    border: 1px solid #a7f3c8;
    color: #166534;
}

.login-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

/* fields */
.field {
    margin-bottom: 20px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.field-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.field-row label {
    margin-bottom: 0;
}

.field-link {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
}

.field-link:hover {
    text-decoration: underline;
}

.field-input {
    position: relative;
}

.field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 20px;
    height: 20px;
    transform: translateY(-50%);
    color: #9aa3bd;
    pointer-events: none;
    transition: color 0.2s;
}

.field-input input {
    width: 100%;
    padding: 15px 16px 15px 48px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #fafaff;
    font: inherit;
    font-size: 15px;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.field-input input::placeholder {
    color: #a3aac0;
}

.field-input input:focus {
    border-color: var(--brand);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(90, 43, 247, 0.12);
}

.field-input:focus-within .field-icon {
    color: var(--brand);
}

/* password show/hide */
.field-input input[type="password"],
.field-input input#password {
    padding-right: 52px;
}

.field-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    transform: translateY(-50%);
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #8b93ad;
    cursor: pointer;
}

.field-toggle:hover {
    background: #f1edff;
    color: var(--brand);
}

.field-toggle svg {
    width: 20px;
    height: 20px;
}

.field-toggle .eye-off,
.field-toggle.is-on .eye-open {
    display: none;
}

.field-toggle.is-on .eye-off {
    display: block;
}

.login-submit {
    width: 100%;
    margin-top: 8px;
}

.login-alt {
    margin-top: 24px;
    text-align: center;
    font-size: 14.5px;
    color: var(--text);
}

.login-alt a {
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
}

.login-alt a:hover {
    text-decoration: underline;
}

.login-copy {
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

/* ---------- Register page (same layout, wider two-column form) ---------- */
.register-card {
    max-width: 580px;
}

.register-trial {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -12px 0 24px;
    padding: 11px 14px;
    border-radius: 12px;
    background: #f3f0ff;
    border: 1px solid #e2dbff;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--brand);
}

.register-trial-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
}

.field-full {
    grid-column: 1 / -1;
}

.field-optional {
    font-weight: 400;
    color: var(--muted);
}

/* keep room for the eye button after a password field is switched to text */
.field-input:has(.field-toggle) input {
    padding-right: 52px;
}

@media (max-width: 600px) {
    .field-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Responsive ---------- */
/* desktop: pin the showcase to one viewport; the laptop fills the space left under the
   copy and fades out at the bottom edge instead of being cut off mid-screen */
@media (min-width: 1101px) {
    .login-showcase {
        position: sticky;
        top: 0;
        align-self: start;
        height: 100vh;
        align-items: stretch;
        padding-bottom: 0;
    }
    .login-showcase-inner {
        display: flex;
        flex-direction: column;
    }
    .login-visual {
        flex: 1;
        min-height: 0;
        margin-top: clamp(20px, 4vh, 40px);
        padding-top: 4px;
        overflow: hidden;
        -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 calc(100% - 64px), transparent 100%);
        mask-image: linear-gradient(180deg, #000 0%, #000 calc(100% - 64px), transparent 100%);
    }
    .login-truck {
        top: 18%;
        bottom: auto;
    }
}

/* shorter desktop screens: tighten vertical rhythm so the copy and form fit without scrolling */
@media (min-width: 1101px) and (max-height: 820px) {
    .login-showcase {
        padding-top: 36px;
    }
    .login-showcase h2 {
        margin-top: 16px;
    }
    .login-features {
        margin-top: 20px;
    }
    .login-form-side {
        padding-top: 20px;
        padding-bottom: 16px;
    }
    .login-card {
        padding: 12px 0;
    }
    .login-logo {
        height: 46px;
        margin-bottom: 22px;
    }
    .login-desc {
        margin-bottom: 20px;
    }
    .field {
        margin-bottom: 16px;
    }
    .field-input input {
        padding-top: 13px;
        padding-bottom: 13px;
    }
    .login-alt {
        margin-top: 18px;
    }
}


@media (max-width: 1100px) {
    .login-layout {
        grid-template-columns: 1fr;
    }
    /* form first on smaller screens; the showcase is decorative */
    .login-showcase {
        display: none;
    }
    .login-form-side {
        min-height: 100vh;
        background:
            radial-gradient(ellipse 60% 40% at 100% 0%, rgba(123, 63, 247, 0.12) 0%, transparent 70%),
            linear-gradient(180deg, #f6f4ff 0%, #ffffff 45%);
    }
}

@media (max-width: 600px) {
    .login-form-side {
        padding: 20px 16px;
    }
    .login-logo {
        height: 42px;
        margin-bottom: 26px;
    }
}
