/* ERP/css/login.css */

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --ln-indigo:   #4338ca;
    --ln-violet:   #5b21b6;
    --ln-blue:     #0369a1;
    --ln-indigo-l: #e0e7ff;
    --ln-text:     #0f172a;
    --ln-muted:    #475569;
    --ln-border:   #e2e8f0;
    --ln-bg:       #f8fafc;
    --ln-font:     'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* Login page only — do not import outside index.aspx / ForgotPassword.aspx */
html, body {
    height: 100%;
    overflow: hidden;
    font-family: var(--ln-font);
    background: #f8fafc;
}
/* ASP.NET wraps everything in <form> — lock it to full height */
#form1 {
    height: 100%;
}
.ln-shell *, .ln-shell *::before, .ln-shell *::after,
.fp-shell *, .fp-shell *::before, .fp-shell *::after {
    box-sizing: border-box; margin: 0; padding: 0;
}

/* ── Layout Shell ───────────────────────────────────────────── */
.ln-shell {
    display: flex;
    height: 100vh;        /* fallback */
    height: 100dvh;       /* mobile: excludes browser chrome */
    overflow: hidden;
}

/* ── Left Accent Panel ──────────────────────────────────────── */
.ln-accent {
    width: 42%;
    background: linear-gradient(155deg, var(--ln-indigo) 0%, var(--ln-violet) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 36px;
    gap: 18px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.ln-accent::before {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 280px; height: 280px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
    pointer-events: none;
}
.ln-accent::after {
    content: '';
    position: absolute;
    bottom: -60px; left: -60px;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
    pointer-events: none;
}
.ln-accent-icon {
    width: 80px; height: 80px;
    background: rgba(255,255,255,.15);
    border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    z-index: 1;
}
.ln-accent-icon img { width: 52px; height: 52px; object-fit: contain; }
.ln-accent-title {
    color: #fff;
    font-size: 22px; font-weight: 700;
    text-align: center; line-height: 1.35;
    z-index: 1;
}
.ln-accent-sub {
    color: rgba(255,255,255,.85);
    font-size: 14px; text-align: center; line-height: 1.55;
    z-index: 1;
}
.ln-badges {
    display: flex; gap: 10px; flex-wrap: wrap;
    justify-content: center; z-index: 1;
}
.ln-badge {
    background: rgba(255,255,255,.14);
    color: rgba(255,255,255,.85);
    font-size: 12px; font-weight: 600;
    padding: 5px 14px; border-radius: 20px;
    white-space: nowrap;
}
.ln-accent-body { display: flex; flex-direction: column; gap: 6px; z-index: 1; }

/* ── Right Form Panel ───────────────────────────────────────── */
.ln-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: stretch;
    padding: 48px 56px;
    width: 100%;
    max-width: 560px;
    background: #fff;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.ln-logo-row {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 28px;
}
.ln-logo-icon {
    width: 40px; height: 40px;
    background: var(--ln-indigo-l);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: var(--ln-indigo);
    flex-shrink: 0;
}
.ln-logo-text { font-size: 15px; font-weight: 700; color: var(--ln-text); }
.ln-logo-sub  { font-size: 12px; color: #5b21b6; font-weight: 500; }
.ln-heading   { font-size: 26px; font-weight: 700; color: var(--ln-text); margin-bottom: 6px; }
.ln-sub       { font-size: 14px; color: var(--ln-muted); margin-bottom: 28px; }

/* ── Inputs ─────────────────────────────────────────────────── */
.ln-field { margin-bottom: 16px; }
.ln-field label {
    display: block;
    font-size: 12px; font-weight: 700;
    letter-spacing: .5px; color: #374151;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.ln-input-wrap { position: relative; }
.ln-input-wrap input {
    width: 100%;
    height: 46px;
    border: 1.5px solid var(--ln-border);
    border-radius: 8px;
    background: var(--ln-bg);
    padding: 0 42px 0 14px;
    font-size: 14px;
    color: var(--ln-text);
    outline: none;
    transition: border-color .15s, background .15s;
    font-family: var(--ln-font);
}
.ln-input-wrap input:focus {
    border-color: var(--ln-indigo);
    background: #fff;
}
.ln-input-wrap input:focus-visible {
    outline: 2px solid var(--ln-indigo);
    outline-offset: 0;
}
.ln-input-wrap input::placeholder { color: #94a3b8; }
.ln-eye {
    position: absolute; right: 10px; top: 50%;
    transform: translateY(-50%);
    color: #94a3b8; cursor: pointer;
    background: none; border: none;
    padding: 4px; border-radius: 4px;
    display: flex; align-items: center;
    line-height: 1; user-select: none;
}
.ln-eye:hover { color: var(--ln-indigo); }
.ln-eye:focus-visible {
    outline: 2px solid var(--ln-indigo);
    outline-offset: 2px;
}
.ln-btn:focus-visible {
    outline: 2px solid var(--ln-indigo);
    outline-offset: 2px;
}

/* ── Inline Validation ──────────────────────────────────────── */
.ln-field-err {
    font-size: 12px; color: #dc2626;
    margin-top: 5px; display: none;
}
.ln-field.has-error .ln-input-wrap input { border-color: #dc2626; }
.ln-field.has-error .ln-field-err        { display: block; }
.ln-form-err {
    background: #fee2e2; border: 1px solid #fecaca;
    border-radius: 8px; padding: 10px 14px;
    font-size: 13px; color: #dc2626;
    margin-bottom: 16px; display: none;
}
.ln-form-warn {
    background: #fff7ed; border: 1px solid #fed7aa;
    border-radius: 8px; padding: 10px 14px;
    font-size: 13px; color: #9a3412;
    margin-bottom: 16px; display: none;
}

/* ── Forgot + Button ────────────────────────────────────────── */
.ln-forgot-row {
    display: flex; justify-content: flex-end;
    margin-top: -6px; margin-bottom: 20px;
}
.ln-forgot-row a {
    font-size: 12px; color: var(--ln-indigo);
    text-decoration: none; font-weight: 500;
}
.ln-forgot-row a:hover { text-decoration: underline; }
.ln-btn {
    width: 100%; height: 48px;
    background: linear-gradient(135deg, var(--ln-indigo) 0%, var(--ln-blue) 100%);
    border: none; border-radius: 8px;
    color: #fff; font-size: 15px; font-weight: 600;
    cursor: pointer; letter-spacing: .3px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: opacity .15s;
    font-family: var(--ln-font);
}
.ln-btn:hover   { opacity: .92; }
.ln-btn:disabled { opacity: .6; cursor: not-allowed; }
.ln-btn-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; }
.ln-btn.loading .ln-btn-text    { display: none; }
.ln-btn.loading .ln-btn-spinner { display: inline-block; animation: ln-spin .7s linear infinite; }
@keyframes ln-spin { to { transform: rotate(360deg); } }

.ln-powered {
    margin-top: 20px; text-align: center;
    font-size: 12px; color: #94a3b8;
}

/* ── Loading overlay ────────────────────────────────────────── */
.ln-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(255,255,255,.6);
    z-index: 9999;
    align-items: center; justify-content: center;
}
.ln-overlay.active { display: flex; }

/* ── Forgot Password Steps ──────────────────────────────────── */
.fp-shell {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(155deg, #f5f3ff 0%, #ede9fe 100%);
    padding: 20px;
}
.fp-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%; max-width: 420px;
    box-shadow: 0 8px 40px rgba(99,102,241,.15);
}
.fp-step { display: none; }
.fp-step.active { display: block; }
.fp-icon {
    width: 56px; height: 56px;
    background: var(--ln-indigo-l);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    margin-bottom: 18px;
}
.fp-title { font-size: 20px; font-weight: 700; color: var(--ln-text); margin-bottom: 6px; }
.fp-sub   { font-size: 13px; color: var(--ln-muted); margin-bottom: 24px; line-height: 1.5; }
.fp-back  { font-size: 12px; color: var(--ln-indigo); cursor: pointer; margin-bottom: 16px; display: inline-block; text-decoration: none; }
.fp-back:hover { text-decoration: underline; }

/* ── OTP Digits ─────────────────────────────────────────────── */
.fp-otp-row {
    display: flex; gap: 10px;
    justify-content: center;
    margin-bottom: 16px;
}
.fp-otp-digit {
    width: 46px; height: 54px;
    border: 2px solid var(--ln-border);
    border-radius: 10px;
    background: var(--ln-bg);
    font-size: 22px; font-weight: 700;
    color: var(--ln-indigo);
    text-align: center;
    outline: none;
    transition: border-color .15s;
    font-family: var(--ln-font);
}
.fp-otp-digit:focus { border-color: var(--ln-indigo); background: #fff; }

/* ── Countdown Timer ────────────────────────────────────────── */
.fp-timer {
    text-align: center;
    font-size: 13px; color: var(--ln-muted);
    margin-bottom: 8px;
}
.fp-timer.urgent { color: #dc2626; font-weight: 600; }
.fp-attempts {
    text-align: center;
    font-size: 12px; color: #d97706;
    margin-bottom: 12px; display: none;
}
.fp-resend {
    text-align: center;
    font-size: 12px; margin-bottom: 16px;
}
.fp-resend-btn {
    color: var(--ln-indigo); cursor: pointer;
    text-decoration: underline; background: none; border: none;
    font-size: 12px; font-family: var(--ln-font);
}
.fp-resend-btn:disabled { color: var(--ln-muted); text-decoration: none; cursor: default; }

/* ── Success panel ──────────────────────────────────────────── */
.fp-success { text-align: center; }
.fp-success-icon {
    width: 64px; height: 64px;
    background: #dcfce7; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; margin: 0 auto 16px;
}

/* ── Password Strength Meter ───────────────────────────────── */
.fp-strength-bar {
    display: flex; gap: 4px;
    margin-top: 6px; margin-bottom: 2px;
}
.fp-strength-seg {
    flex: 1; height: 4px;
    border-radius: 2px;
    background: #e2e8f0;
    transition: background .2s;
}
.fp-strength-label {
    font-size: 12px; font-weight: 600;
    min-height: 14px; margin-bottom: 4px;
}
#fpStrengthBar.weak   #fpSeg1 { background: #dc2626; }
#fpStrengthBar.medium #fpSeg1,
#fpStrengthBar.medium #fpSeg2 { background: #f97316; }
#fpStrengthBar.strong #fpSeg1,
#fpStrengthBar.strong #fpSeg2,
#fpStrengthBar.strong #fpSeg3 { background: #22c55e; }

/* ── Skip Link ──────────────────────────────────────────────── */
.ln-skip-link {
    position: absolute;
    top: -100%;
    left: 12px;
    padding: 8px 16px;
    background: var(--ln-indigo);
    color: #fff;
    font-size: 14px; font-weight: 600;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    text-decoration: none;
    transition: top .15s;
}
.ln-skip-link:focus { top: 0; }

/* ── Reduced Motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .ln-input-wrap input,
    .ln-btn,
    .ln-eye { transition: none; }
    .ln-btn-spinner { animation: none; border-top-color: #fff; opacity: .7; }
}

/* ── Mobile (≤ 640px) ───────────────────────────────────────── */
@media (max-width: 640px) {
    .ln-shell { flex-direction: column; }
    .ln-accent {
        width: 100%;
        height: 130px;
        flex-shrink: 0;
        padding: 20px 24px;
        flex-direction: row;
        gap: 14px;
        align-items: center;
        justify-content: flex-start;
    }
    .ln-accent::before, .ln-accent::after { display: none; }
    .ln-accent-icon { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; }
    .ln-accent-icon img { width: 32px; height: 32px; }
    .ln-accent-body { display: flex; flex-direction: column; gap: 2px; }
    .ln-accent-title { font-size: 15px; text-align: left; }
    .ln-accent-sub   { font-size: 12px; text-align: left; }
    .ln-badges { display: none; }
    .ln-form-panel { padding: 28px 20px 40px; }
    .ln-heading { font-size: 20px; }
    .fp-card { padding: 28px 20px; }
    .fp-otp-digit { width: 40px; height: 48px; font-size: 18px; }
}
