/* =====================================================================
   AUTH / LOGIN - premium glassmorphism login experience
   ===================================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.login-body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh; display: grid; place-items: center; padding: 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 45%, #0d9488 100%);
    background-size: 200% 200%;
    animation: gradShift 16s ease infinite;
    position: relative; overflow-x: hidden; color: #1e293b;
}
@keyframes gradShift { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }

/* floating orbs */
.orb { position: fixed; border-radius: 50%; filter: blur(60px); opacity: .5; pointer-events: none; z-index: 0; }
.orb.o1 { width: 340px; height: 340px; background: #38bdf8; top: -80px; left: -60px; animation: float1 18s ease-in-out infinite; }
.orb.o2 { width: 300px; height: 300px; background: #f472b6; bottom: -70px; right: -40px; animation: float2 22s ease-in-out infinite; }
.orb.o3 { width: 220px; height: 220px; background: #a78bfa; top: 40%; right: 12%; animation: float1 26s ease-in-out infinite reverse; }
@keyframes float1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(40px,50px)} }
@keyframes float2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-50px,-40px)} }

.login-shell { position: relative; z-index: 2; width: 100%; max-width: 980px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 0; background: rgba(255,255,255,.14); backdrop-filter: blur(24px); border: 1px solid rgba(255,255,255,.28); border-radius: 26px; box-shadow: 0 30px 80px rgba(15,23,42,.42); overflow: hidden; }

.login-hero { padding: 46px 40px; color: #fff; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(160deg, rgba(15,23,42,.42), rgba(15,23,42,.16)); position: relative; }
.login-hero .brand { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.login-hero .brand .logo { width: 52px; height: 52px; border-radius: 15px; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35); display: grid; place-items: center; font-size: 24px; font-weight: 800; }
.login-hero .brand b { font-size: 20px; display: block; }
.login-hero .brand span { font-size: 12.5px; opacity: .8; }
.login-hero h1 { font-size: 30px; line-height: 1.2; margin-bottom: 14px; letter-spacing: -.02em; }
.login-hero p { font-size: 14.5px; opacity: .9; line-height: 1.65; margin-bottom: 26px; }
.hero-features { display: flex; flex-direction: column; gap: 13px; }
.hero-feature { display: flex; align-items: center; gap: 12px; font-size: 13.5px; opacity: .95; }
.hero-feature .hf-ico { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22); display: grid; place-items: center; flex-shrink: 0; }

.login-card { padding: 46px 40px; background: rgba(255,255,255,.94); display: flex; flex-direction: column; justify-content: center; }
.login-card h2 { font-size: 23px; margin-bottom: 6px; }
.login-card .sub { color: #64748b; font-size: 13.5px; margin-bottom: 26px; }

/* Role selector */
.role-select { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 22px; }
.role-opt { position: relative; cursor: pointer; }
.role-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.role-opt .ro-box { border: 2px solid #e2e8f0; border-radius: 13px; padding: 12px 10px; text-align: center; transition: all .18s; background: #fff; }
.role-opt .ro-box .ro-ico { width: 36px; height: 36px; margin: 0 auto 7px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 17px; }
.role-opt .ro-box b { font-size: 12.5px; display: block; color: #334155; }
.role-opt input:checked + .ro-box { border-color: var(--rc, #4f46e5); background: color-mix(in srgb, var(--rc, #4f46e5) 7%, #fff); box-shadow: 0 4px 14px color-mix(in srgb, var(--rc,#4f46e5) 25%, transparent); transform: translateY(-2px); }
.role-opt input:checked + .ro-box b { color: var(--rc, #4f46e5); }
.role-opt[data-role="management"] { --rc: #4f46e5; }
.role-opt[data-role="tele_calling"] { --rc: #0d9488; }
.role-opt[data-role="project_manager"] { --rc: #ea580c; }
.role-opt[data-role="project_head"] { --rc: #7c3aed; }
.ro-ico.mgmt { background: #4f46e5; } .ro-ico.tele { background: #0d9488; }
.ro-ico.pm { background: #ea580c; } .ro-ico.ph { background: #7c3aed; }

/* Fields */
.lfield { margin-bottom: 16px; }
.lfield label { display: block; font-size: 12.5px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.linput-wrap { position: relative; }
.linput-wrap .li-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.linput { width: 100%; padding: 12px 14px 12px 44px; border: 1.5px solid #e2e8f0; border-radius: 12px; background: #fff; outline: none; font-size: 14px; transition: all .18s; color: #1e293b; }
.linput:focus { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.linput.err { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,38,.1); }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: none; background: none; cursor: pointer; color: #94a3b8; border-radius: 9px; display: grid; place-items: center; }
.pw-toggle:hover { background: #f1f5f9; color: #4f46e5; }

.lrow { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; font-size: 13px; }
.remember { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: #475569; font-weight: 500; }
.remember input { width: 17px; height: 17px; accent-color: #4f46e5; cursor: pointer; }
.forgot { color: #4f46e5; font-weight: 600; }
.forgot:hover { text-decoration: underline; }

.btn-login { width: 100%; padding: 13px; border: none; border-radius: 12px; background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; transition: all .18s; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 8px 24px rgba(79,70,229,.36); }
.btn-login:hover { filter: brightness(1.07); box-shadow: 0 10px 30px rgba(79,70,229,.46); transform: translateY(-1px); }
.btn-login:disabled { opacity: .7; cursor: not-allowed; transform: none; }
.btn-login .spinner { width: 19px; height: 19px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: none; }
.btn-login.loading .spinner { display: block; }
.btn-login.loading .lbl { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { padding: 12px 14px; border-radius: 11px; font-size: 13px; font-weight: 500; margin-bottom: 18px; display: none; align-items: center; gap: 10px; }
.alert.show { display: flex; animation: shakeIn .3s ease; }
.alert.error { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert.info { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert.success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
@keyframes shakeIn { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)} 40%{transform:translateX(6px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(4px)} }

.login-foot { text-align: center; margin-top: 22px; font-size: 12px; color: #94a3b8; }

@media (max-width: 860px) {
    .login-shell { grid-template-columns: 1fr; max-width: 460px; }
    .login-hero { display: none; }
    .login-card { padding: 38px 28px; }
}
@media (max-width: 400px) {
    .role-select { grid-template-columns: 1fr 1fr; gap: 8px; }
    .login-card { padding: 30px 20px; }
}
