/* =========================================================
   Welding Manager - Sign-in page (Graphite theme)
   Load after tabler.min.css and wm-modern.css.
   ========================================================= */

.wm-login { min-height: 100vh; background: var(--tblr-body-bg); }

.wm-login-shell {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---- Brand panel: photo slideshow ---- */
.wm-login-brand {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
    padding: 2.5rem 3rem 1.75rem;
    color: #ffffff;
    background: #0f0f12;   /* shown until the first photo arrives */
}

.wm-login-slides { position: absolute; inset: 0; z-index: -2; }
.wm-slide {
    position: absolute; inset: 0;
    background-size: cover; background-repeat: no-repeat;
    opacity: 0; transform: scale(1.02);
    transition: opacity 1.4s ease;
    will-change: opacity, transform;
}
.wm-slide.is-active { opacity: 1; animation: wm-kenburns 9s ease-out forwards; }
@keyframes wm-kenburns { from { transform: scale(1.02); } to { transform: scale(1.12); } }

/* Shade: keeps the text readable on any photo; violet tint ties the photos to the Graphite theme */
.wm-login-shade {
    position: absolute; inset: 0; z-index: -1;
    background:
        linear-gradient(180deg, rgba(10, 8, 20, .70) 0%, rgba(10, 8, 20, .10) 28%, rgba(10, 8, 20, .15) 50%, rgba(10, 8, 20, .88) 100%),
        linear-gradient(90deg, rgba(103, 65, 217, .28) 0%, rgba(103, 65, 217, 0) 60%);
}

.wm-login-brand-top { display: flex; align-items: center; gap: .75rem; font-weight: 700; font-size: 1.05rem; text-shadow: 0 1px 8px rgba(0, 0, 0, .4); }
.wm-login-logo { width: 40px; height: 40px; object-fit: contain; }
.wm-login-brand-top .wm-login-logo { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45)); }

.wm-login-brand-body { margin-top: auto; }
/* Title and motto share one width: the script sizes the title to the motto's width */
.wm-login-heading { display: inline-flex; flex-direction: column; align-items: flex-start; max-width: 100%; }
.wm-login-brand h1 {
    display: inline-block; white-space: nowrap;
    margin: 0 0 .45rem; color: #ffffff;
    font-size: 3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1;
    text-shadow: 0 2px 24px rgba(0, 0, 0, .35);
}
.wm-login-brand h1 span {
    background: linear-gradient(90deg, #ffb347 0%, #ff7a3d 45%, #c4b5fd 100%);   /* weld-arc glow */
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wm-login-motto {
    display: inline-block; white-space: nowrap; margin: 0;
    font-size: clamp(1.3rem, 2vw, 1.8rem); font-weight: 600; letter-spacing: .01em; color: rgba(255, 255, 255, .9);
    text-shadow: 0 1px 10px rgba(0, 0, 0, .45);
}

/* Progress: one bar per photo, the current one fills while it is shown */
.wm-login-progress { display: flex; gap: .4rem; margin-top: 1.75rem; max-width: 22rem; }
.wm-login-progress span { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.wm-login-progress i { display: block; height: 100%; width: 0; background: #ffffff; border-radius: 3px; }
.wm-login-progress span.is-done i { width: 100%; }
.wm-login-progress span.is-active i { animation: wm-progress 7s linear forwards; }
@keyframes wm-progress { to { width: 100%; } }

/* ---- "Welded word": one keyword at a time, welded at the middle right (script in Login.cshtml) ---- */
.wm-login-welds { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.wm-login-brand-top, .wm-login-brand-body, .wm-login-brand-foot { position: relative; z-index: 1; }

.wm-weld {
    position: absolute; white-space: nowrap; padding-bottom: .4em;
    font-size: clamp(1.6rem, 2.6vw, 2.5rem);
    font-weight: 800; letter-spacing: .14em; text-transform: uppercase; line-height: 1;
}
/* Letters appear behind the travelling spark, white-hot first, then cool down */
.wm-weld-text {
    display: block; color: #fff6e0;
    clip-path: inset(-30% 100% -30% 0);
    text-shadow: 0 0 6px #ffb347, 0 0 16px #ff7a3d, 0 0 32px rgba(255, 90, 30, .75);
}
.wm-weld.is-welding .wm-weld-text {
    animation: wm-weld-reveal var(--weld) linear forwards, wm-weld-cool 2.6s ease-out var(--weld) forwards;
}
@keyframes wm-weld-reveal { to { clip-path: inset(-30% -2% -30% 0); } }
@keyframes wm-weld-cool {
    0%   { color: #fff6e0; text-shadow: 0 0 6px #ffb347, 0 0 16px #ff7a3d, 0 0 32px rgba(255, 90, 30, .75); }
    35%  { color: #ffc27a; text-shadow: 0 0 4px #ff7a3d, 0 0 12px rgba(255, 90, 30, .45); }
    100% { color: rgba(255, 255, 255, .9); text-shadow: 0 1px 12px rgba(0, 0, 0, .6); }
}
/* The bead under the word: laid by the spark, glows, then cools to the theme violet */
.wm-weld-bead {
    position: absolute; left: 0; bottom: 0; width: 0; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, #ff7a3d, #ffd28a);
    box-shadow: 0 0 8px rgba(255, 140, 60, .9);
}
.wm-weld.is-welding .wm-weld-bead {
    animation: wm-bead-lay var(--weld) linear forwards, wm-bead-cool 2.6s ease-out var(--weld) forwards;
}
@keyframes wm-bead-lay { to { width: 100%; } }
@keyframes wm-bead-cool { to { background: rgba(196, 181, 253, .75); box-shadow: 0 0 0 transparent; } }

/* The welding arc at the tip, flickering, with sparks flying off it */
.wm-weld-spark {
    position: absolute; left: 0; top: 42%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
    background: radial-gradient(circle, #ffffff 0 28%, #ffe2a8 45%, rgba(255, 122, 61, 0) 72%);
    box-shadow: 0 0 14px 5px rgba(255, 180, 90, .9), 0 0 36px 14px rgba(255, 100, 40, .45);
    opacity: 0;
}
.wm-weld.is-welding .wm-weld-spark {
    animation: wm-spark-move var(--weld) linear forwards, wm-spark-flicker .08s steps(2) infinite;
}
@keyframes wm-spark-move { 0% { left: 0; opacity: 1; } 94% { opacity: 1; } 100% { left: 100%; opacity: 0; } }
@keyframes wm-spark-flicker { 0% { transform: scale(.75); } 100% { transform: scale(1.25); } }
.wm-weld-spark i {
    position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; border-radius: 50%;
    background: #ffd28a; box-shadow: 0 0 6px #ff9a3d; opacity: 0;
    animation-name: wm-particle; animation-timing-function: ease-out; animation-iteration-count: infinite;
}
@keyframes wm-particle {
    0%   { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); }
}
.wm-weld.is-fading { animation: wm-weld-out .9s ease forwards; }
@keyframes wm-weld-out { to { opacity: 0; filter: blur(4px); transform: translateY(-6px); } }

.wm-login-brand-foot { display: flex; align-items: center; gap: 1rem; font-size: .8125rem; color: rgba(255, 255, 255, .75); }
.wm-login-brand-foot a { color: inherit; text-decoration: none; }
.wm-login-brand-foot a:hover { color: #ffffff; }
.wm-login-brand-foot .ti { font-size: 1.35rem; }

@media (prefers-reduced-motion: reduce) {
    .wm-slide.is-active { animation: none; transform: none; }
    .wm-login-welds { display: none; }
}

/* ---- Form side ---- */
.wm-login-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1.5rem; }
.wm-login-card { width: 100%; max-width: 400px; }
.wm-login-title { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: .35rem; }
.wm-login-mobile-brand { display: none; align-items: center; gap: .75rem; margin-bottom: 2rem; }

.wm-login .form-label { font-weight: 600; }
.wm-login .form-control, .wm-login .form-select { min-height: 44px; }
.wm-login .input-icon .form-select { padding-left: 2.5rem; }
.wm-login .input-group-flat .input-group-text { padding-top: 0; padding-bottom: 0; }

.wm-login-alert { display: flex; gap: .6rem; align-items: flex-start; }
.wm-login-alert .ti { font-size: 1.25rem; flex-shrink: 0; }
.wm-login-errors ul { margin: 0; padding: 0; list-style: none; }

.wm-capslock { display: flex; align-items: center; gap: .35rem; margin-top: .4rem; font-size: .8125rem; font-weight: 600; color: var(--tblr-warning); }
.wm-capslock[hidden] { display: none; }

.wm-login-submit { min-height: 46px; font-weight: 700; font-size: .95rem; }
.wm-login-submit-busy { display: none; align-items: center; }
.wm-login-submit.is-busy .wm-login-submit-text { display: none; }
.wm-login-submit.is-busy .wm-login-submit-busy { display: inline-flex; }

.wm-login-card-foot {
    display: flex; align-items: center; gap: .75rem; margin-top: 2.5rem; padding-top: 1.25rem;
    border-top: 1px solid var(--tblr-border-color); font-size: .75rem; color: var(--tblr-secondary);
}
.wm-login-card-foot .ti { font-size: 1.15rem; }

/* ---- Small screens: hide the brand panel, show a compact header ---- */
@media (max-width: 991.98px) {
    .wm-login-shell { grid-template-columns: 1fr; }
    .wm-login-brand { display: none; }
    .wm-login-mobile-brand { display: flex; }
    .wm-login-main { align-items: flex-start; padding-top: 3rem; }
}
