/* Ocean HRMS — Login (Armor scene · Ocean orange branding · compact form) */
:root {
  --brand: #F5A01B;
  --brand-deep: #d4890f;
  --brand-soft: #fff4e5;
  --brand-glow: rgba(245, 160, 27, 0.35);
  --brand-rgb: 245, 160, 27;
  --ink: #211F23;
  --muted: #6b7280;
  --line: #e5e7eb;
  --surface: #ffffff;
  --page: #ffffff;
  --font: "Cabin", Calibri, "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-weight: 500;
  color: var(--ink);
  overflow-x: clip;
  overflow-y: auto;
  position: relative;
  background:
    radial-gradient(1000px 520px at 8% -5%, rgba(var(--brand-rgb), 0.12), transparent 55%),
    radial-gradient(900px 480px at 100% 10%, rgba(var(--brand-rgb), 0.09), transparent 50%),
    radial-gradient(700px 420px at 50% 110%, rgba(var(--brand-rgb), 0.08), transparent 55%),
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    var(--page);
  background-size: auto, auto, auto, 32px 32px, 32px 32px, auto;
}

/* ========== Background scene ========== */
.bg-scene {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.bg-orb {
  position: absolute; border-radius: 50%; filter: blur(70px);
  z-index: 0; pointer-events: none; will-change: transform, opacity;
}
.bg-orb.one {
  width: 360px; height: 360px; background: rgba(var(--brand-rgb), 0.14);
  top: -90px; left: -70px; animation: orbDriftA 18s ease-in-out infinite alternate;
}
.bg-orb.two {
  width: 400px; height: 400px; background: rgba(var(--brand-rgb), 0.1);
  bottom: -120px; right: -80px; animation: orbDriftB 22s ease-in-out infinite alternate;
}
.bg-orb.three {
  width: 220px; height: 220px; background: rgba(var(--brand-rgb), 0.07);
  top: 42%; left: 58%; filter: blur(50px);
  animation: orbDriftC 16s ease-in-out infinite alternate;
}

.bg-icon {
  position: absolute; pointer-events: none;
  color: rgba(var(--brand-rgb), 0.15); line-height: 1;
  will-change: transform, opacity;
}
.bg-icon.slate { color: rgba(51, 65, 85, 0.13); }
.bg-icon.gear-xl { top: -40px; right: -40px; font-size: 220px; opacity: 0.55; animation: bob 12s ease-in-out infinite; }
.bg-icon.gear-md { top: 140px; right: 160px; font-size: 90px; animation: bob 9s ease-in-out infinite reverse; }
.bg-icon.gear-sm { top: 9%; left: 6%; font-size: 58px; animation: bob 10s ease-in-out infinite 1s; }
.bg-icon.flame-a { top: 30%; left: 13%; font-size: 40px; animation: flicker 2.6s ease-in-out infinite; }
.bg-icon.flame-b { top: 52%; right: 9%; font-size: 34px; animation: flicker 3.1s ease-in-out infinite 0.8s; }
.bg-icon.drop-a { top: 18%; left: 30%; font-size: 27px; animation: bob 7s ease-in-out infinite; }
.bg-icon.drop-b { top: 12%; right: 30%; font-size: 25px; animation: bob 8s ease-in-out infinite 1.4s; }
.bg-icon.shield { top: 40%; right: 21%; font-size: 30px; animation: bob 7s ease-in-out infinite 1s; }
.bg-icon.hydrant { top: 44%; left: 5%; font-size: 52px; animation: bob 8s ease-in-out infinite; }
.bg-icon.extinguisher { top: 22%; right: 6%; font-size: 48px; animation: bob 9s ease-in-out infinite 2s; }
.bg-icon.nut { top: 64%; left: 17%; font-size: 36px; animation: bob 6.5s ease-in-out infinite reverse; }

/* ========== HR conveyor (bottom) ========== */
.hr-line {
  position: absolute; left: 0; right: 0; bottom: 0; height: 152px;
  pointer-events: none; z-index: 1; --lane-l: max(14%, 165px);
}
.hr-line::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 20px;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.08), rgba(148, 163, 184, 0.2));
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}
.hr-desk {
  position: absolute; left: calc(var(--lane-l) - 148px); bottom: 18px;
  width: 150px; height: 110px;
}
.hr-desk-svg { width: 100%; height: 100%; display: block; }
.hr-desk .hr-screen { animation: hrScreen 2.4s ease-in-out infinite; }
.hr-desk-lamp {
  position: absolute; left: 112px; top: 8px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(var(--brand-rgb), 0.4);
  box-shadow: 0 0 18px 6px rgba(var(--brand-rgb), 0.35);
  animation: hrLampGlow 2s ease-in-out infinite;
}
.hr-paper {
  position: absolute; width: 22px; height: 28px; border-radius: 2px;
  background: #fff; border: 1px solid #cbd5e1; box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
}
.hr-paper.p1 { left: 118px; bottom: 52px; transform: rotate(8deg); animation: hrPaperShift 3.5s ease-in-out infinite; }
.hr-paper.p2 { left: 128px; bottom: 48px; transform: rotate(-4deg); animation: hrPaperShift 3.5s ease-in-out infinite 0.6s; }

.hr-belt {
  position: absolute; left: var(--lane-l); right: 9%; bottom: 36px; height: 10px; border-radius: 6px;
  background: repeating-linear-gradient(90deg, #52525b 0 14px, #3f3f46 14px 28px);
  box-shadow: 0 3px 0 #27272a, 0 6px 10px rgba(0, 0, 0, 0.12);
  animation: hrBeltRun 0.9s linear infinite;
}
.hr-belt::after {
  content: ''; position: absolute; left: 10px; right: 10px; top: 13px; height: 9px;
  background: repeating-linear-gradient(90deg, #71717a 0 4px, transparent 4px 60px);
}
.hr-lane {
  position: absolute; left: var(--lane-l); right: 9%; bottom: 46px; height: 64px;
}
.hr-item {
  position: absolute; bottom: 0; left: 0; width: 56px; height: 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px;
  opacity: 0; animation: hrTravel 18s linear infinite; animation-delay: var(--d);
}
.hr-item-ico { width: 38px; height: 38px; filter: drop-shadow(0 3px 3px rgba(15, 23, 42, 0.18)); }
.hr-item-ico svg { width: 100%; height: 100%; display: block; overflow: visible; }
.hr-item.hot .hr-item-ico {
  filter: drop-shadow(0 0 6px rgba(var(--brand-rgb), 0.4)) drop-shadow(0 3px 3px rgba(15, 23, 42, 0.15));
}
.hr-item-label {
  display: inline-block; font-family: var(--font);
  font-size: 12px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase;
  line-height: 1.25; color: #111; background: #fff; border: 1.5px solid var(--brand);
  border-radius: 999px; padding: 3px 8px; white-space: nowrap;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.14);
}
.hr-item-label.ok { color: #fff; background: #16a34a; border-color: #15803d; }

.hr-gate {
  position: absolute; left: calc(var(--lane-l) + (91% - var(--lane-l)) * 0.72);
  bottom: 34px; width: 70px; height: 100px;
}
.hr-gate .hr-beam {
  position: absolute; left: 10px; right: 10px; top: 26px; height: 3px; border-radius: 3px;
  background: #22c55e; box-shadow: 0 0 10px 2px rgba(34, 197, 94, 0.65);
  animation: hrScan 1.8s ease-in-out infinite alternate;
}
.hr-gate .hr-lamp { animation: hrLampBlink 1.2s steps(2, jump-none) infinite; }

.hr-done {
  position: absolute; right: 1.2%; bottom: 28px; width: 118px; height: 78px;
  display: flex; align-items: flex-end; gap: 8px;
}
.hr-done-card {
  position: relative; width: 42px; height: 52px; border-radius: 4px;
  background: #fff; border: 1px solid #cbd5e1; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 3px; padding: 6px 4px 5px;
}
.hr-done-card > i { display: block; width: 70%; height: 3px; border-radius: 2px; background: #fed7aa; }
.hr-done-card > i:nth-child(2),
.hr-done-card > i:nth-child(3) { background: #e2e8f0; width: 60%; }
.hr-done-card .hr-item-label {
  position: absolute; left: 50%; bottom: -2px; transform: translate(-50%, 50%);
  font-size: 10px; padding: 2px 6px;
}
.hr-done-box {
  width: 58px; height: 58px; border-radius: 8px; background: var(--brand); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(var(--brand-rgb), 0.35); line-height: 1.1;
}
.hr-done-box strong { font-size: 14px; font-weight: 800; letter-spacing: 0.04em; }
.hr-done-box small { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; color: #ffedd5; }

@keyframes flicker {
  0%, 100% { transform: scale(1) translateY(0); opacity: 0.7; }
  30% { transform: scale(1.12, 0.94) translateY(-2px); opacity: 1; }
  60% { transform: scale(0.94, 1.08) translateY(1px); opacity: 0.8; }
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-14px) rotate(2deg); }
}
@keyframes orbDriftA {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.08); }
}
@keyframes orbDriftB {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-50px, -25px) scale(1.06); }
}
@keyframes orbDriftC {
  from { transform: translate(0, 0); opacity: 0.7; }
  to { transform: translate(-30px, 40px); opacity: 1; }
}
@keyframes hrBeltRun { to { background-position: 28px 0; } }
@keyframes hrTravel {
  0% { left: 0; opacity: 0; transform: translateY(4px); }
  4% { opacity: 1; transform: translateY(0); }
  94% { opacity: 1; }
  100% { left: calc(100% - 56px); opacity: 0; }
}
@keyframes hrScan { from { top: 24px; } to { top: 82px; } }
@keyframes hrLampBlink { 0% { fill: #22c55e; } 100% { fill: #bbf7d0; } }
@keyframes hrScreen { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.75; } }
@keyframes hrLampGlow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes hrPaperShift {
  0%, 100% { transform: rotate(8deg) translateY(0); }
  50% { transform: rotate(4deg) translateY(-3px); }
}

/* ========== Center / Card (slightly smaller) ========== */
.login-center {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: safe center;
  padding: 20px 16px 150px; box-sizing: border-box;
}

.login-card {
  position: relative; width: 100%; max-width: 400px;
  background: var(--surface); border-radius: 20px;
  padding: 24px 24px 18px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1), 0 2px 8px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(33, 31, 35, 0.06); overflow: hidden;
}
.login-card::before,
.login-card::after {
  content: ""; position: absolute; width: 24px; height: 24px;
  border-color: var(--brand); border-style: solid; pointer-events: none; z-index: 2;
}
.login-card::before { top: 12px; left: 12px; border-width: 2.5px 0 0 2.5px; }
.login-card::after { bottom: 12px; right: 12px; border-width: 0 2.5px 2.5px 0; }

.login-hub-badge {
  position: absolute; top: 12px; right: 14px; z-index: 3;
  font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--brand); background: var(--brand-soft);
  border: 1px solid rgba(var(--brand-rgb), 0.35); border-radius: 999px;
  padding: 4px 9px; animation: badgeIn 0.7s ease 0.35s both;
}
@keyframes badgeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-brand { text-align: center; margin-bottom: 12px; padding-top: 2px; }
.login-since {
  font-size: 10px; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: #9ca3af; margin-bottom: 8px;
}
.login-logo {
  width: auto; max-width: 210px; height: 88px;
  object-fit: contain; display: block; margin: 0 auto 4px;
  animation: logoEnter 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both,
             logoFloat 4.5s ease-in-out 1.1s infinite;
}
@keyframes logoEnter {
  0% { opacity: 0; transform: translateY(14px) scale(0.88); filter: blur(4px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.login-portal-title {
  margin-top: 8px; font-family: var(--font);
  font-size: 19px; font-weight: 800; color: var(--ink);
  letter-spacing: -0.02em; line-height: 1.2;
  animation: fieldIn 0.5s ease 0.35s both;
}
.login-tagline {
  margin-top: 4px; font-size: 12px; color: var(--muted); font-weight: 600;
  animation: fieldIn 0.5s ease 0.42s both;
}

.login-alert {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  font-size: 13px; margin-bottom: 10px;
}
.login-alert.success { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }

.login-form { display: grid; gap: 10px; }
.login-field label {
  display: block; font-size: 12px; font-weight: 800; color: #374151; margin-bottom: 5px;
}

.login-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.login-role { cursor: pointer; }
.login-role input { display: none; }
.login-role-box {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 10px 10px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fafafa;
  transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  min-height: 78px; position: relative; overflow: hidden;
}
.login-role-box::after {
  content: ""; position: absolute; top: 9px; right: 9px;
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid #d1d5db; transition: all 0.25s;
}
.login-role-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; margin-bottom: 4px;
  background: #f3f4f6; color: #9ca3af; font-size: 13px; transition: all 0.25s;
}
.login-role-box b { font-size: 13px; color: #111; }
.login-role-box small { font-size: 10px; color: #9ca3af; line-height: 1.3; }

.login-role input:checked + .login-role-box {
  border-color: var(--brand);
  background: linear-gradient(180deg, #fff8ec, #fff);
  box-shadow: 0 6px 18px var(--brand-glow);
  transform: translateY(-1px);
}
.login-role input:checked + .login-role-box::after {
  border-color: var(--brand); background: var(--brand);
  box-shadow: inset 0 0 0 2.5px #fff;
}
.login-role input:checked + .login-role-box .login-role-icon {
  background: var(--brand); color: #fff;
  box-shadow: 0 4px 12px var(--brand-glow);
}
.login-role:hover .login-role-box { border-color: rgba(var(--brand-rgb), 0.5); }

.login-input-wrap { position: relative; display: flex; align-items: center; }
.login-input-wrap > i:first-child {
  position: absolute; left: 12px; color: #9ca3af; font-size: 14px;
  pointer-events: none; z-index: 1; transition: color 0.25s;
}
.login-input-wrap input {
  width: 100%; padding: 11px 14px 11px 38px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font: 600 15px/1.4 var(--font);
  color: var(--ink); background: #fff; outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}
.login-input-wrap.has-toggle input { padding-right: 44px; }
.login-input-wrap input::placeholder { color: #9ca3af; }
.login-input-wrap:focus-within input {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.18);
  transform: translateY(-1px);
}
.login-input-wrap:focus-within > i:first-child { color: var(--brand); }

.login-pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: 8px;
  background: transparent; color: #9ca3af; cursor: pointer;
  display: grid; place-items: center; z-index: 2;
  transition: color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.login-pw-toggle:hover,
.login-pw-toggle:focus-visible {
  color: var(--brand-deep); background: var(--brand-soft); outline: none;
}
.login-pw-toggle.is-on { color: var(--brand-deep); }
.login-pw-toggle i { font-size: 15px; pointer-events: none; }

.login-btn {
  margin-top: 2px; width: 100%; border: 0; border-radius: 10px;
  padding: 12px 16px; cursor: pointer; color: #fff;
  font: 700 14px/1 var(--font);
  letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--brand); box-shadow: 0 10px 24px var(--brand-glow);
  position: relative; overflow: hidden;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.25s ease;
  animation: btnPulse 2.8s ease-in-out 1.2s infinite;
}
.login-btn::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,0.28) 48%, transparent 76%);
  transform: translateX(-130%);
  animation: btnShine 3.6s ease-in-out 1.6s infinite;
  pointer-events: none;
}
.login-btn:hover,
.login-btn:focus,
.login-btn:focus-visible,
.login-btn:active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 24px var(--brand-glow);
  transform: none;
  outline: none;
}
.login-btn-text { position: relative; z-index: 1; color: #fff; }

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 10px 24px var(--brand-glow); }
  50% { box-shadow: 0 12px 30px rgba(var(--brand-rgb), 0.5); }
}
@keyframes btnShine {
  0%, 55%, 100% { transform: translateX(-130%); }
  70% { transform: translateX(130%); }
}

.login-card-foot {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px solid #f0f0f0; text-align: center;
}
.login-card-foot .foot-label {
  display: block; font-size: 9px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: #9ca3af; margin-bottom: 3px;
}
.login-card-foot .foot-brand {
  display: block; font-size: 12px; font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink);
}
.login-copy {
  margin-top: 12px; font-size: 11px; color: #9ca3af; text-align: center; font-weight: 600;
}

.anim-in {
  opacity: 0;
  animation: cardIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(22px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-form .login-field {
  opacity: 0;
  animation: fieldIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.login-form .login-field:nth-child(1) { animation-delay: 0.28s; }
.login-form .login-field:nth-child(2) { animation-delay: 0.36s; }
.login-form .login-field:nth-child(3) { animation-delay: 0.44s; }
.login-btn {
  opacity: 1;
  animation: fieldIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.52s both,
             btnPulse 2.8s ease-in-out 1.2s infinite;
}
@keyframes fieldIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-height: 860px) {
  .login-logo { max-width: 180px; height: 72px; }
  .login-portal-title { font-size: 18px; }
  .login-center { padding-bottom: 140px; }
}

@media (max-width: 767.98px), (max-height: 700px) {
  .hr-line { transform: scale(0.82); transform-origin: bottom center; opacity: 0.92; }
  .bg-icon.gear-md, .bg-icon.extinguisher, .bg-icon.hydrant { display: none; }
  .login-center { padding-bottom: 115px; }
}

@media (max-width: 480px) {
  .login-card { padding: 20px 14px 16px; border-radius: 18px; max-width: 100%; }
  .login-logo { max-width: 170px; height: 70px; }
  .login-portal-title { font-size: 17px; }
  .login-roles { grid-template-columns: 1fr; }
  .login-role-box { min-height: auto; }
  .hr-line { display: none; }
  .bg-icon.gear-xl { font-size: 150px; }
  .bg-icon.shield, .bg-icon.flame-b, .bg-icon.nut, .bg-icon.drop-b { display: none; }
  .login-center { padding: 18px 12px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-orb, .bg-icon, .bg-scene *, .hr-line *, .anim-in,
  .login-hub-badge, .login-portal-title, .login-tagline,
  .login-form .login-field, .login-btn, .login-logo {
    animation: none !important; opacity: 1 !important;
    transform: none !important; filter: none !important;
  }
  .hr-item { opacity: 1; }
}
