/* Lock root rem — avoids ~12.5% scale-up if html font-size ≠ 16px */
html {
    font-size: 16px;
}

/* =============================================================================
   TOKENS — app/globals.css .dark (login page)
   ============================================================================= */
.login-layout-body {
    --background: 240 10% 3.9%;
    --foreground: 210 20% 98%;
    --card: 240 3.7% 15.9% / 0.6;
    --card-foreground: 220 14.3% 95.9%;
    --muted: 240 3.7% 15.9%;
    --muted-foreground: 217.9 10.6% 64.9%;
    --primary: 271.5 81.3% 55.9%;
    --primary-foreground: 0 0% 100%;
    --destructive: 0 72.2% 50.6%;
    --destructive-foreground: 0 0% 98%;
    --border: 240 3.7% 15.9%;
    --input: 218.2 26% 24.9%;
    --ring: 272.1 71.7% 47.1%;
    --radius: 0.625rem;

    margin: 0;
    min-height: 100vh;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: "Roboto", system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
}

.login-layout-body *,
.login-layout-body *::before,
.login-layout-body *::after {
    box-sizing: border-box;
}

/* =============================================================================
PAGE
   ============================================================================= */
.login-page-outer {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(
        to bottom right,
        hsl(var(--background)),
        hsl(var(--muted)),
        hsl(var(--primary) / 0.1)
    );
}

.login-page-frame {
    width: 100%;
    max-width: 1152px;
    margin-inline: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    align-items: center;
}

@media (min-width: 1024px) {
    .login-page-frame {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 32px;
    }
}

/* =============================================================================
LEFT COLUMN
   ============================================================================= */
.login-brand-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
    width: 100%;
}

@media (min-width: 1024px) {
    .login-brand-column {
        text-align: left;
    }
}

.login-brand-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.login-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
}

@media (min-width: 1024px) {
    .login-logo-row {
        justify-content: flex-start;
    }
}

.login-logo-circle {
    width: 3rem;
    height: 3rem;
    flex-shrink: 0;
    border-radius: 9999px;
    background-color: hsl(var(--destructive));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.login-logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Brand title — text-3xl font-bold */
.login-brand-title,
h1.login-brand-title {
    margin: 0;
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 700;
    letter-spacing: normal;
    color: hsl(var(--foreground));
}

/* Tagline — text-xl text-muted-foreground max-w-lg */
.login-brand-tagline,
p.login-brand-tagline {
    margin: 0 auto;
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 400;
    color: hsl(var(--muted-foreground));
    max-width: 32rem;
    width: 100%;
}

@media (min-width: 1024px) {
    .login-brand-tagline,
    p.login-brand-tagline {
        margin-left: 0;
        margin-right: 0;
    }
}

/* Badge grid — grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2 max-w-lg */
.login-badges {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    place-items: center;
    max-width: 32rem;
    width: 100%;
    margin: 0 auto;
    list-style: none;
    padding: 0;
}

@media (min-width: 640px) {
    .login-badges {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .login-badges {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-left: 0;
        margin-right: 0;
    }
}

.login-badge-cell {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-badge-cell img,
.login-badges > img {
    width: 140px;
    height: auto;
    object-fit: contain;
    display: block;
}

/* =============================================================================
RIGHT COLUMN — flex justify-center lg:justify-end
   ============================================================================= */
.login-form-column {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
}

@media (min-width: 1024px) {
    .login-form-column {
        justify-content: flex-end;
    }
}

/* =============================================================================
CARD SHELL
   ============================================================================= */
.login-card {
    width: 100%;
    max-width: 448px;
    border-radius: var(--radius);
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border) / 0.2);
    color: hsl(var(--card-foreground));
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    transition: box-shadow 200ms ease;
    display: flex;
    flex-direction: column;
    padding: 0;
}

@media (min-width: 1024px) {
    .login-card {
        width: 448px !important;
        max-width: 448px !important;
        background-color: rgba(34, 34, 37, 0.58) !important;
        border-radius: 12px !important;
        border: none !important;
        box-shadow: none !important;
    }
}

/* =============================================================================
CARD INTERIOR — matches dashboard CardHeader / CardContent structure
   ============================================================================= */
   
/* CardHeader: flex flex-col space-y-1.5 p-6 + space-y-2 text-center */
.login-card-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
    text-align: center;
}

/* CardTitle — text-2xl font-bold */
.login-card-title,
h1.login-card-title,
h2.login-card-title {
    margin: 0;
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 700;
    color: hsl(var(--foreground));
}

/* CardDescription — text-sm text-muted-foreground */
.login-card-description {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 400;
    color: hsl(var(--muted-foreground));
}

/* CardContent: p-6 pt-0 space-y-6 */
.login-card-content {
    padding: 1.5rem;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* form space-y-4 */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
}

/* shadcn Input — for your email/password fields */
.login-form .form-group {
    margin: 0;
    text-align: left;
}

.login-form .form-label {
    display: block;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    margin-bottom: 0.5rem;
}

.login-form .form-control {
    display: flex;
    width: 100%;
    height: 2.5rem;
    border-radius: calc(var(--radius) - 2px);
    background-color: #ffffff;
    border: 1px solid #e4e4e7;
    color: #18181b;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 400;
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.login-form .form-control::placeholder {
    color: #71717a;
}

.login-form .form-control:focus {
    outline: none;
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.25);
}

.login-form .text-danger {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: hsl(var(--destructive));
}

/* Submit button — matches tenant <Button variant="gradient" className="w-full h-12 font-semibold text-lg shadow-lg hover:shadow-xl transition-all duration-200"> */
.login-card .login-submit-btn,
.login-card .login-btn-primary,
.login-card button[type="submit"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem;
    width: 100% !important;
    height: 3rem !important;
    border: none !important;
    border-radius: calc(var(--radius) - 2px) !important;
    background-color: rgb(0, 0, 0) !important;
    background-image: linear-gradient(
        to right,
        rgb(147, 51, 234),
        color(srgb 0.576927 0.200467 0.917533 / 0.7)
    ) !important;
    color: rgb(255, 255, 255) !important;
    box-shadow:
        0 4px 6px -1px rgb(0 0 0 / 0.01),
        0 1px 3px 0 rgb(0 0 0 / 0.01) !important;
    padding: 0.5rem 1rem !important;
    cursor: pointer;
    white-space: nowrap;
    font-size: 1.125rem;
    line-height: 1.75rem;
    font-weight: 600;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.login-card button[type="submit"]:hover {
    background-image: linear-gradient(
        to right,
        color(srgb 0.576927 0.200467 0.917533 / 0.9),
        color(srgb 0.576927 0.200467 0.917533 / 0.6)
    ) !important;
}

.login-card button[type="submit"]:active {
    transform: scale(0.98);
}

.login-card button[type="submit"]:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px hsl(var(--background)),
        0 0 0 4px hsl(var(--ring)) !important;
}

.login-card button[type="submit"]:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.login-card button[type="submit"] svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.login-card button[type="submit"] .login-btn-icon-lead {
    margin-right: 0.5rem;
}

.login-card button[type="submit"] .login-btn-icon-trail {
    margin-left: 0.5rem;
}

/* Divider — “Secure Authentication” (same styles if you use a divider) */
.login-divider {
    position: relative;
}

.login-divider-line-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.login-divider-line {
    width: 100%;
    border: 0;
    border-top: 1px solid hsl(var(--border));
    margin: 0;
}

.login-divider-label-row {
    position: relative;
    display: flex;
    justify-content: center;
}

.login-divider-pill {
    background-color: hsl(var(--background));
    padding: 0 0.5rem;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: hsl(var(--muted-foreground));
}

/* Legal block — text-center space-y-2 */
.login-legal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.login-legal-line {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 400;
    color: hsl(var(--muted-foreground));
}

.login-legal-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.75rem;
    line-height: 1rem;
}

.login-legal-links a {
    color: hsl(var(--primary));
    text-decoration: none;
}

.login-legal-links a:hover {
    text-decoration: underline;
}

/* Optional: forgot-password line — same text scale as legal copy */
.login-forgot-password {
    margin: 0;
    text-align: center;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 400;
    color: hsl(var(--muted-foreground));
}

.login-forgot-password a {
    color: hsl(var(--primary));
    text-decoration: none;
}

.login-forgot-password a:hover {
    text-decoration: underline;
}

/* Error alert (dashboard shows on error; style aligned to tokens) */
.login-alert {
    margin-top: 0.5rem;
    border-radius: calc(var(--radius) - 2px);
    border: 1px solid hsl(var(--destructive));
    background-color: hsl(var(--destructive) / 0.1);
    color: hsl(var(--destructive));
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.login-alert p {
    margin: 0;
}

.login-alert-success {
    border-color: hsl(142 71.8% 29.2%);
    background-color: hsl(142 71.8% 29.2% / 0.15);
    color: hsl(142 76% 36%);
}

/* Card footer — powered-by + secondary links (reset password, etc.) */
.login-card-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.login-card-footer .login-legal-line {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 400;
    color: hsl(var(--muted-foreground));
}

.login-card-footer a {
    color: hsl(var(--primary));
    text-decoration: none;
}

.login-card-footer a:hover {
    text-decoration: underline;
}