/* =================================================================
   AUTO WORKSHOP – Login (split-screen, enterprise)
   Left: NumzRIG brand panel + slogan.  Right: clean sign-in form.
   System teal palette (--primary #2c5f7a). No effects, no gimmicks.
   ================================================================= */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

/* ── SHELL ─────────────────────────────────────────────────────── */
.login-wrapper { min-height: 100vh; display: flex; }
.login-decoration { display: none; }

/* ── BRAND PANEL (left) ────────────────────────────────────────── */
.brand-panel {
    flex: 0 0 46%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: 3.25rem 3rem;
    color: #ffffff;
    background: linear-gradient(158deg, #337391 0%, #2c5f7a 44%, #1e4a63 100%);
    overflow: hidden;
}
/* Very low-key light fall to give the flat teal some depth. */
.brand-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, .08), transparent 55%);
    pointer-events: none;
}
.brand-panel > * { position: relative; z-index: 1; }

.brand-mark {
    align-self: flex-start;
    display: inline-flex;
    padding: 9px 15px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .35);
}
.brand-mark img { height: 26px; width: auto; display: block; }

.brand-panel__body { max-width: 430px; }
.brand-slogan {
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 700;
    line-height: 1.13;
    letter-spacing: -.4px;
    margin-bottom: 1.1rem;
}
.brand-lede {
    font-size: 15px;
    line-height: 1.65;
    color: rgba(255, 255, 255, .86);
    margin-bottom: 2rem;
    max-width: 400px;
}
.brand-panel__foot { font-size: 12px; color: rgba(255, 255, 255, .6); }

/* ── FORM PANEL (right) ────────────────────────────────────────── */
.form-panel {
    flex: 1 1 54%;
    min-width: 0;            /* allow the flex item to shrink below content width */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    background: #ffffff;
}
.login-card { width: 100%; max-width: 460px; }

/* ── HEADER ────────────────────────────────────────────────────── */
.card-header { text-align: center; margin-bottom: 1.9rem; }
.brand-logo img { display: block; margin: 0 auto 1.25rem; }
.brand-title, .brand-icon { display: none; }
.form-title {
    font-size: 23px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.4px;
}
.brand-subtitle {
    margin-top: .4rem;
    color: #64748b;
    font-size: 13.5px;
    font-weight: 500;
}

/* ── FORM ──────────────────────────────────────────────────────── */
.login-form { margin-bottom: .25rem; }
.input-group { margin-bottom: 1.15rem; }
.input-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: .1px;
}

/* Label row: label on the left, Caps Lock warning on the right */
.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.label-row .input-label { margin-bottom: 0; }
.caps-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2px;
    color: #b45309;               /* amber warning, from theme accent */
}
.caps-hint i { font-size: 9px; }
.caps-hint[hidden] { display: none; }

.input-field { position: relative; }
.input-icon {
    position: absolute;
    left: .8rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 13px;
    pointer-events: none;
}
.form-input {
    width: 100%;
    height: 42px;
    padding: 0 2.5rem 0 2.35rem;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 500;
    color: #1e293b;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-input::placeholder { color: #a8b3c1; }
.form-input:hover { border-color: #b3c0cf; }
.form-input:focus {
    border-color: #2c5f7a;
    box-shadow: 0 0 0 3px rgba(44, 95, 122, .13);
}
.input-field:focus-within .input-icon { color: #2c5f7a; }

/* Error state — highlights the field, not just the message below */
.input-field.has-error .form-input { border-color: #dc2626; }
.input-field.has-error .input-icon { color: #dc2626; }
.input-field.has-error .form-input:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .13);
}
.password-toggle {
    position: absolute;
    right: .5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: .35rem;
    font-size: 13px;
    line-height: 0;
    transition: color .12s ease;
}
.password-toggle:hover { color: #2c5f7a; }

/* ── OPTIONS ROW ───────────────────────────────────────────────── */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 1.15rem 0 1.25rem;
    font-size: 13px;
}
.checkbox-container {
    display: flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    color: #475569;
    position: relative;
    padding-left: 24px;
    user-select: none;
}
.checkbox-container input { position: absolute; opacity: 0; cursor: pointer; }
.checkmark {
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    height: 16px; width: 16px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    transition: background .15s, border-color .15s;
}
.checkbox-container:hover input ~ .checkmark { border-color: #2c5f7a; }
.checkbox-container input:checked ~ .checkmark {
    background: #2c5f7a;
    border-color: #2c5f7a;
}
.checkmark::after {
    content: "";
    position: absolute;
    display: none;
    left: 5px; top: 2px;
    width: 4px; height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.checkbox-container input:checked ~ .checkmark::after { display: block; }
.forgot-link {
    color: #2c5f7a;
    text-decoration: none;
    font-weight: 500;
    transition: color .12s;
}
.forgot-link:hover { color: #1e4a63; text-decoration: underline; }

/* ── PRIMARY BUTTON ────────────────────────────────────────────── */
.btn-login {
    width: 100%;
    height: 42px;
    background: #2c5f7a;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: .3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    position: relative;
    overflow: hidden;
    transition: background .15s ease;
}
.btn-login:hover  { background: #26536b; }
.btn-login:active { background: #1e4a63; }
.btn-login .btn-icon { font-size: 12px; opacity: .9; }
.btn-login.loading { pointer-events: none; cursor: default; }
.btn-login.loading .btn-text,
.btn-login.loading .btn-icon { visibility: hidden; }
.btn-login.loading::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    border: 2px solid rgba(255, 255, 255, .5);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── ERROR / NOTICE ────────────────────────────────────────────── */
.error-message {
    margin-top: 1rem;
    padding: .6rem .8rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b42318;
    font-size: 12.5px;
    line-height: 1.45;
    display: flex;
    align-items: flex-start;
    gap: .5rem;
}
.error-message i { margin-top: 2px; font-size: 12.5px; }

/* Amber "notice" variant (subscription expired, session expired, wrong portal…) */
.error-message.is-warning {
    background: #fff3cd;
    border-color: #f59e0b;
    color: #92400e;
}

/* Alert stack sits at the top of the form, just under the header */
.form-alerts { margin-bottom: .25rem; }
.form-alerts .error-message { margin-top: 0; }
.form-alerts .error-message + .error-message { margin-top: .6rem; }

/* ── KEYBOARD FOCUS (accessibility) ────────────────────────────── */
.btn-login:focus-visible,
.forgot-link:focus-visible,
.password-toggle:focus-visible {
    outline: 2px solid #2c5f7a;
    outline-offset: 2px;
    border-radius: 6px;
}
.checkbox-container input:focus-visible ~ .checkmark {
    box-shadow: 0 0 0 3px rgba(44, 95, 122, .25);
    border-color: #2c5f7a;
}

/* ── FOOTER (tenant "powered by", mobile only) ─────────────────── */
.card-footer {
    display: none;           /* on desktop the left panel carries the brand */
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 1.75rem;
    padding-top: 1.1rem;
    border-top: 1px solid #eef2f5;
}
.powered-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: #94a3b8;
    font-weight: 500;
}
.powered-logo { height: 20px; width: auto; opacity: .8; }

/* ── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .brand-panel { display: none; }
    .form-panel { flex: 1 1 100%; }
    .card-footer { display: flex; }   /* restore NumzRIG under the form */
}
@media (max-width: 480px) {
    .form-panel { padding: 2rem 1.25rem; }
}

/* ── PRINT ─────────────────────────────────────────────────────── */
@media print {
    .brand-panel { display: none; }
    .form-panel { background: #ffffff; }
}

/* =================================================================
   CUSTOM ENHANCEMENTS — restrained, on-brand micro-interactions.
   Layered on top of the base styles; safe to remove as a block.
   All motion is disabled under prefers-reduced-motion (see below).
   ================================================================= */

/* Card lifts off the white panel with a hairline border + soft shadow,
   and eases in on load. */
.login-card {
    padding: 2.25rem 2rem;
    border: 1px solid #eef2f5;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 42, 58, .04),
                0 12px 32px -12px rgba(16, 42, 58, .12);
    animation: card-in .5s cubic-bezier(.16, .84, .44, 1) both;
}
@keyframes card-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Logo settles in just after the card. */
.brand-logo img { animation: fade-in .6s ease .1s both; }

/* Fields + options + button reveal in a gentle stagger. */
.login-form > .input-group,
.login-form > .form-options,
.login-form > .btn-login {
    animation: rise-in .45s cubic-bezier(.16, .84, .44, 1) both;
}
.login-form > .input-group:nth-of-type(1) { animation-delay: .12s; }
.login-form > .input-group:nth-of-type(2) { animation-delay: .18s; }
.login-form > .form-options              { animation-delay: .24s; }
.login-form > .btn-login                 { animation-delay: .30s; }
@keyframes rise-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Error/notice stack slides down and gives one attention-grabbing shake. */
.form-alerts { animation: alert-drop .35s ease both, alert-shake .5s ease .35s; }
@keyframes alert-drop {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes alert-shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

/* Button: micro-lift on hover + a soft sheen sweep on press-in. */
.btn-login {
    transition: background .15s ease, transform .12s ease, box-shadow .15s ease;
    box-shadow: 0 1px 2px rgba(28, 74, 99, .18);
}
.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -6px rgba(28, 74, 99, .45);
}
.btn-login:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(28, 74, 99, .18); }
.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .5s ease;
}
.btn-login:hover::before { transform: translateX(120%); }

/* Inputs get a hair more lift when active. */
.form-input:focus { box-shadow: 0 0 0 3px rgba(44, 95, 122, .13), 0 2px 8px -4px rgba(44, 95, 122, .3); }

/* Brand panel: slow, living teal gradient that drifts across the panel,
   with a second bloom layer floating on top for depth. */
.brand-panel {
    background: linear-gradient(150deg, #2f7794 0%, #2c5f7a 30%, #1e4a63 60%, #2c5f7a 82%, #337391 100%);
    background-size: 300% 300%;
    animation: brand-drift 18s ease-in-out infinite;
}
@keyframes brand-drift {
    0%   { background-position:   0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position:   0% 50%; }
}
/* Soft light bloom drifts opposite the gradient for a subtle parallax. */
.brand-panel::after {
    animation: bloom-float 16s ease-in-out infinite;
}
@keyframes bloom-float {
    0%   { transform: translate(0, 0) scale(1); opacity: 1; }
    50%  { transform: translate(-6%, 5%) scale(1.15); opacity: .75; }
    100% { transform: translate(0, 0) scale(1); opacity: 1; }
}

/* Respect users who prefer less motion — kill all of the above animation. */
@media (prefers-reduced-motion: reduce) {
    .login-card,
    .brand-logo img,
    .login-form > .input-group,
    .login-form > .form-options,
    .login-form > .btn-login,
    .form-alerts,
    .brand-panel,
    .brand-panel::after {
        animation: none !important;
    }
    .btn-login,
    .btn-login:hover { transform: none; }
    .btn-login::before { display: none; }
}
