:root {
    --login-ease-out: cubic-bezier(.16, 1, .3, 1);
    --login-accent: #b42318;
    --login-accent-hover: #9a1d13;
    --login-ink: #18181b;
    --login-muted: #52525b;
    --login-border: #d4d4d8;
}

/* Layout */
.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(28rem, 44%) 1fr;
    background: #fff;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: #fff;
}

.login-card {
    width: 100%;
    max-width: 24rem;
    animation: login-card-in 450ms var(--login-ease-out) both;
}

/* Brand and heading */
.login-brand {
    margin-bottom: 3.5rem;
    color: var(--login-ink);
}

.login-brand .brand-mark {
    display: block;
    object-fit: contain;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.login-brand small {
    color: #71717a;
}

.login-heading {
    margin-bottom: 2rem;
}

.login-title {
    margin: 0 0 .5rem;
    color: var(--login-ink);
    font-size: 1.875rem;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.login-subtitle {
    margin: 0;
    color: var(--login-muted);
    font-size: .95rem;
    line-height: 1.55;
}

/* Form */
.login-form {
    display: grid;
    gap: 1.25rem;
}

.login-field {
    display: grid;
    gap: .4rem;
}

.login-field .form-label {
    margin: 0;
    color: var(--login-ink);
    font-size: .85rem;
    font-weight: 600;
}

.input-icon {
    position: relative;
}

.input-icon > i:first-child {
    position: absolute;
    top: 50%;
    left: .95rem;
    color: #a1a1aa;
    font-size: 1rem;
    transform: translateY(-50%);
    pointer-events: none;
    transition: color 150ms ease;
}

.input-icon:focus-within > i:first-child {
    color: var(--login-accent);
}

.login-field .form-control {
    min-height: 3rem;
    padding: .7rem .95rem .7rem 2.75rem;
    border: 1px solid var(--login-border);
    border-radius: .65rem;
    background: #fff;
    color: var(--login-ink);
    box-shadow: 0 1px 2px rgba(24, 24, 27, .04);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.login-field .form-control::placeholder {
    color: #a1a1aa;
}

.login-field .form-control:hover {
    border-color: #a1a1aa;
}

.login-field .form-control:focus {
    border-color: var(--login-accent);
    box-shadow: 0 0 0 .2rem rgba(180, 35, 24, .14);
    outline: 0;
}

.password-control,
.input-icon .form-control[type="password"],
.input-icon .form-control#login-password {
    padding-right: 3.25rem;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: .4rem;
    width: 2.3rem;
    height: 2.3rem;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: .5rem;
    color: #71717a;
    background: transparent;
    transform: translateY(-50%);
    transition: color 150ms ease, background-color 150ms ease, transform 100ms var(--login-ease-out);
}

.password-toggle:hover {
    color: var(--login-ink);
    background: #f4f4f5;
}

.password-toggle:active {
    transform: translateY(-50%) scale(.94);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--login-accent);
    outline-offset: 1px;
}

.login-options {
    display: flex;
    align-items: center;
    min-height: 1.5rem;
}

.login-options .form-check-label {
    color: var(--login-muted);
    font-size: .875rem;
}

/* Submit */
.login-submit {
    min-height: 3rem;
    margin-top: .25rem;
    border: 0;
    border-radius: .65rem;
    background: var(--login-accent);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(24, 24, 27, .12), inset 0 1px 0 rgba(255, 255, 255, .14);
    transition: background-color 150ms ease, box-shadow 150ms ease, transform 100ms var(--login-ease-out);
}

.login-submit:hover {
    background: var(--login-accent-hover);
    box-shadow: 0 6px 16px rgba(180, 35, 24, .22), inset 0 1px 0 rgba(255, 255, 255, .14);
}

.login-submit:active {
    transform: scale(.985);
}

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

.login-submit .button-arrow {
    transition: transform 180ms var(--login-ease-out);
}

.login-submit:hover .button-arrow {
    transform: translateX(3px);
}

.login-submit .button-spinner {
    display: none;
}

.login-submit.is-loading .button-spinner {
    display: inline-block;
}

.login-submit.is-loading .button-arrow {
    display: none;
}

/* Bootstrap's own button states (active, disabled) would otherwise switch the button to its default blue. */
.login-submit.btn-primary {
    --bs-btn-active-bg: var(--login-accent-hover);
    --bs-btn-active-border-color: var(--login-accent-hover);
    --bs-btn-disabled-bg: #18181b;
    --bs-btn-disabled-border-color: #18181b;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-opacity: 1;
}

.login-submit:disabled,
.login-submit.is-loading {
    cursor: wait;
    color: #fff;
    background: #18181b;
    box-shadow: 0 1px 2px rgba(24, 24, 27, .2);
    opacity: 1;
}

.login-security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin: 1.5rem 0 0;
    color: #71717a;
    font-size: .78rem;
}

.validation-summary-valid {
    display: none;
}

/* Visual side */
.login-visual {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: clamp(3rem, 6vw, 6rem);
    color: #fff;
    background:
        radial-gradient(60rem 40rem at 90% -10%, rgba(234, 88, 12, .35), transparent 60%),
        radial-gradient(40rem 30rem at -10% 110%, rgba(180, 35, 24, .45), transparent 60%),
        #1c1917;
}

/* Remove the decorative ring defined in Site.css */
.login-visual::before {
    content: none;
}

.login-visual-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .1;
    background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 60% 40%, #000, transparent 75%);
}

.login-showcase {
    width: 100%;
    max-width: 34rem;
    animation: login-card-in 600ms 80ms var(--login-ease-out) both;
}

.login-feature {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    margin-bottom: 1.5rem;
    padding: .4rem .8rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    color: rgba(255, 255, 255, .9);
    background: rgba(255, 255, 255, .06);
    font-size: .78rem;
    font-weight: 600;
}

.live-dot {
    width: .45rem;
    height: .45rem;
    border-radius: 50%;
    background: #4ade80;
    animation: status-pulse 1.8s ease-out infinite;
}

.login-showcase h2 {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 3.4vw, 3rem);
    font-weight: 650;
    line-height: 1.08;
    letter-spacing: -.035em;
}

.login-lead {
    max-width: 30rem;
    margin: 0 0 2.5rem;
    color: rgba(255, 255, 255, .72);
    font-size: 1rem;
    line-height: 1.65;
}

/* Product preview card */
.preview-card {
    padding: 1.25rem;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 1rem;
    background: rgba(255, 255, 255, .06);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 24px 48px rgba(0, 0, 0, .28);
    backdrop-filter: blur(16px);
}

.preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, .85);
    font-size: .82rem;
    font-weight: 600;
}

.preview-badge {
    padding: .15rem .55rem;
    border-radius: 999px;
    color: #bbf7d0;
    background: rgba(74, 222, 128, .14);
    font-size: .7rem;
}

.preview-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
    margin-bottom: 1.1rem;
}

.preview-stats > div {
    padding: .8rem .9rem;
    border-radius: .7rem;
    background: rgba(255, 255, 255, .06);
}

.preview-stats strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 650;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.preview-stats small {
    color: rgba(255, 255, 255, .58);
    font-size: .72rem;
}

.preview-feed {
    list-style: none;
    margin: 0;
    padding: 0;
}

.preview-feed li {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .8rem;
    padding: .7rem 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.preview-feed strong,
.preview-feed small {
    display: block;
}

.preview-feed strong {
    font-size: .83rem;
    font-weight: 600;
}

.preview-feed small {
    color: rgba(255, 255, 255, .55);
    font-size: .72rem;
}

.preview-feed em {
    color: rgba(255, 255, 255, .5);
    font-size: .72rem;
    font-style: normal;
}

.preview-icon {
    width: 2.1rem;
    height: 2.1rem;
    display: grid;
    place-items: center;
    border-radius: .6rem;
    font-size: .9rem;
}

.preview-icon.ok {
    color: #86efac;
    background: rgba(74, 222, 128, .14);
}

.preview-icon.warm {
    color: #fdba74;
    background: rgba(251, 146, 60, .16);
}

/* Preview chart */
.preview-chart {
    position: relative;
    margin-bottom: 1rem;
    padding: .8rem .9rem .5rem;
    border-radius: .7rem;
    background: rgba(255, 255, 255, .06);
}

.preview-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .4rem;
    color: rgba(255, 255, 255, .6);
    font-size: .72rem;
}

.preview-trend {
    color: #86efac;
    font-weight: 600;
}

.chart-svg {
    display: block;
    width: 100%;
    height: 5.5rem;
    overflow: visible;
}

.chart-grid line {
    stroke: rgba(255, 255, 255, .08);
    stroke-dasharray: 3 4;
}

.chart-line {
    fill: none;
    stroke: #fb923c;
    stroke-width: 2.5;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: chart-draw 1600ms 500ms var(--login-ease-out) forwards;
}

.chart-area {
    opacity: 0;
    animation: chart-fade 900ms 1100ms ease-out forwards;
}

.chart-dot {
    position: absolute;
    top: calc(.8rem + 1.5rem + 10 / 96 * 5.5rem);
    right: .9rem;
    width: .6rem;
    height: .6rem;
    margin: -.3rem 0 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 .25rem rgba(251, 146, 60, .35);
    opacity: 0;
    animation: chart-fade 400ms 2000ms ease-out forwards, dot-pulse 2s 2400ms ease-out infinite;
}

/* Staggered entrance for the preview card */
.preview-card {
    animation: login-card-in 700ms 300ms var(--login-ease-out) both;
}

.preview-stats > div {
    animation: login-card-in 500ms var(--login-ease-out) both;
}

.preview-stats > div:nth-child(1) { animation-delay: 450ms; }
.preview-stats > div:nth-child(2) { animation-delay: 550ms; }
.preview-stats > div:nth-child(3) { animation-delay: 650ms; }

.preview-feed li:nth-child(1) { animation: feed-in 500ms 1000ms var(--login-ease-out) both; }
.preview-feed li:nth-child(2) { animation: feed-in 500ms 1150ms var(--login-ease-out) both; }
.preview-feed li:nth-child(3) { animation: feed-in 500ms 1300ms var(--login-ease-out) both; }

.preview-feed li.is-new {
    animation: feed-in 500ms var(--login-ease-out) both;
    background: linear-gradient(90deg, rgba(74, 222, 128, .12), transparent 70%);
}

@keyframes chart-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes chart-fade {
    to { opacity: 1; }
}

@keyframes dot-pulse {
    0% { box-shadow: 0 0 0 0 rgba(251, 146, 60, .5); }
    70%, 100% { box-shadow: 0 0 0 .6rem rgba(251, 146, 60, 0); }
}

@keyframes feed-in {
    from { opacity: 0; transform: translateX(-14px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Motion */
@keyframes login-card-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes status-pulse {
    0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .4); }
    70%, 100% { box-shadow: 0 0 0 .45rem rgba(74, 222, 128, 0); }
}

/* Responsive */
@media (max-width: 1100px) {
    .login-page { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .login-panel { min-height: 100vh; }
}

@media (max-width: 560px) {
    .login-panel { padding: 2rem 1.25rem; align-items: flex-start; }
    .login-brand { margin-bottom: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .login-card,
    .login-showcase,
    .live-dot,
    .preview-card,
    .preview-stats > div,
    .preview-feed li,
    .chart-dot {
        animation: none;
    }

    .chart-line { stroke-dashoffset: 0; animation: none; }
    .chart-area, .chart-dot { opacity: 1; animation: none; }

    .login-submit .button-arrow { transition: none; }
}
