/*
|--------------------------------------------------------------------------
| File: public/assets/css/auth.css
|--------------------------------------------------------------------------
| CoreF5 Enterprise ERP Authentication
| Part 1 : Foundation + Layout + Background
|--------------------------------------------------------------------------
*/

/*=========================================================
    ROOT DESIGN TOKENS
=========================================================*/

:root {
  --bg: #030712;
  --bg-soft: #071324;
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.04);

  --white: #ffffff;

  --text: #f8fafc;
  --muted: #94a3b8;

  --primary: #2563eb;
  --secondary: #7c3aed;
  --cyan: #06b6d4;

  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;

  --glass-border: rgba(255, 255, 255, 0.12);

  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.45);

  --shadow-xl: 0 50px 120px rgba(0, 0, 0, 0.6);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;

  --transition: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/*=========================================================
    RESET
=========================================================*/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: Inter, sans-serif;

  background: var(--bg);

  color: var(--text);

  overflow: hidden;

  min-height: 100vh;

  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;

  text-decoration: none;
}

svg {
  display: block;
}

/*=========================================================
    APP
=========================================================*/

.auth-app {
  position: relative;

  width: 100%;

  height: 100vh;

  overflow: hidden;
}

/*=========================================================
    BACKGROUND
=========================================================*/

.background-layer {
  position: absolute;

  inset: 0;

  overflow: hidden;

  z-index: 1;
}

/*=========================================================
    ERROR ALERT
=========================================================*/

.auth-error-alert {
  display: none;
  align-items: center;
  gap: 10px;
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 20px;
  animation: fadeIn 0.3s ease-in-out;
}

.auth-error-alert svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/*=========================================================
    AURORA
=========================================================*/

.aurora-layer {
  position: absolute;

  inset: -20%;

  filter: blur(120px);

  opacity: 0.85;

  animation: auroraMove 24s linear infinite;
}

.aurora-layer::before {
  content: "";

  position: absolute;

  width: 900px;
  height: 900px;

  background: #2563eb;

  border-radius: 50%;

  left: -150px;
  top: 120px;

  opacity: 0.45;
}

.aurora-layer::after {
  content: "";

  position: absolute;

  width: 800px;
  height: 800px;

  border-radius: 50%;

  background: #7c3aed;

  right: -150px;
  top: -100px;

  opacity: 0.35;
}

@keyframes auroraMove {
  0% {
    transform: translate3d(0, 0, 0);
  }

  50% {
    transform: translate3d(-80px, -40px, 0);
  }

  100% {
    transform: translate3d(0, 0, 0);
  }
}

/*=========================================================
    MESH
=========================================================*/

.mesh-layer {
  position: absolute;

  inset: 0;

  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(37, 99, 235, 0.22),
      transparent 45%
    ),
    radial-gradient(
      circle at 80% 15%,
      rgba(124, 58, 237, 0.2),
      transparent 40%
    ),
    radial-gradient(
      circle at 80% 90%,
      rgba(6, 182, 212, 0.18),
      transparent 42%
    ),
    radial-gradient(circle at 10% 85%, rgba(37, 99, 235, 0.18), transparent 42%);
}

/*=========================================================
    GRID
=========================================================*/

.mesh-layer::after {
  content: "";

  position: absolute;

  inset: 0;

  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);

  background-size: 48px 48px;

  mask-image: radial-gradient(circle, black 55%, transparent 100%);
}

/*=========================================================
    NOISE
=========================================================*/

.noise-layer {
  position: absolute;

  inset: 0;

  opacity: 0.035;

  background-image: radial-gradient(circle, #fff 1px, transparent 1px);

  background-size: 4px 4px;
}

/*=========================================================
    GLOWS
=========================================================*/

.glow {
  position: absolute;

  border-radius: 50%;

  filter: blur(90px);

  opacity: 0.4;
}

.glow-one {
  width: 420px;

  height: 420px;

  background: #2563eb;

  left: -120px;

  bottom: -120px;
}

.glow-two {
  width: 500px;

  height: 500px;

  background: #7c3aed;

  right: -150px;

  top: -120px;
}

.glow-three {
  width: 360px;

  height: 360px;

  background: #06b6d4;

  left: 50%;

  top: 55%;

  transform: translate(-50%, -50%);
}

/*=========================================================
    PARTICLES
=========================================================*/

.particle-layer {
  position: absolute;

  inset: 0;
}

.particle {
  position: absolute;

  width: 2px;

  height: 2px;

  background: white;

  border-radius: 50%;

  opacity: 0.25;

  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  from {
    transform: translateY(100vh);
  }

  to {
    transform: translateY(-120vh);
  }
}

/*
---------------------------------------------------
Random distribution
---------------------------------------------------
*/

.particle:nth-child(1) {
  left: 3%;
  animation-duration: 17s;
}

.particle:nth-child(2) {
  left: 6%;
  animation-duration: 21s;
}

.particle:nth-child(3) {
  left: 10%;
  animation-duration: 18s;
}

.particle:nth-child(4) {
  left: 14%;
  animation-duration: 26s;
}

.particle:nth-child(5) {
  left: 18%;
  animation-duration: 23s;
}

.particle:nth-child(6) {
  left: 22%;
  animation-duration: 19s;
}

.particle:nth-child(7) {
  left: 28%;
  animation-duration: 16s;
}

.particle:nth-child(8) {
  left: 33%;
  animation-duration: 25s;
}

.particle:nth-child(9) {
  left: 39%;
  animation-duration: 21s;
}

.particle:nth-child(10) {
  left: 45%;
  animation-duration: 18s;
}

.particle:nth-child(11) {
  left: 52%;
  animation-duration: 24s;
}

.particle:nth-child(12) {
  left: 58%;
  animation-duration: 22s;
}

.particle:nth-child(13) {
  left: 63%;
  animation-duration: 19s;
}

.particle:nth-child(14) {
  left: 69%;
  animation-duration: 27s;
}

.particle:nth-child(15) {
  left: 74%;
  animation-duration: 20s;
}

.particle:nth-child(16) {
  left: 81%;
  animation-duration: 17s;
}

.particle:nth-child(17) {
  left: 88%;
  animation-duration: 25s;
}

.particle:nth-child(18) {
  left: 94%;
  animation-duration: 21s;
}

/* remaining particles repeat automatically */

/*=========================================================
    AUTH CONTAINER
=========================================================*/

.authentication-layer {
  position: relative;

  z-index: 50;

  width: 100%;

  height: 100%;

  display: flex;

  align-items: center;

  justify-content: center;

  padding: 60px;
}

/*=========================================================
    LOGIN CARD
=========================================================*/

.login-card {
  position: relative;
  width: 500px;
  max-width: 100%;
  backdrop-filter: blur(30px);
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  padding: 32px 48px;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0)
  );
  pointer-events: none;
}

/*=========================================================
    HEADER
=========================================================*/

.login-header {
  margin-bottom: 24px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 25px;
  justify-content: center;
}

.brand-logo {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 20px 50px rgba(37, 99, 235, 0.45);
}

.brand-logo svg {
  width: 34px;

  height: 34px;

  fill: white;
}

.brand-name {
  display: block;

  font-size: 26px;

  font-family: "Space Grotesk", sans-serif;

  font-weight: 700;
}

.brand-edition {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  letter-spacing: 0.18em;
  font-size: 11px;
}

.login-header h1 {
  font-size: 36px;
  line-height: 1.05;
  font-family: "Space Grotesk", sans-serif;
  margin-bottom: 15px;
}

.login-header p {
  color: var(--muted);
  line-height: 1.8;
  font-size: 15px;
}

/*=========================================================
    BUSINESS NETWORK
=========================================================*/

.business-network {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.28;
}

.business-network svg {
  width: 100%;
  height: 100%;
}

.network-lines line {
  stroke: url(#networkStroke);

  stroke-width: 1.2;

  stroke-linecap: round;

  stroke-dasharray: 10 10;

  animation: lineFlow 18s linear infinite;
}

@keyframes lineFlow {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -400;
  }
}

.network-core circle:first-child {
  fill: rgba(37, 99, 235, 0.08);

  stroke: #2563eb;

  stroke-width: 2;

  animation: corePulse 4s ease-in-out infinite;
}

.network-core circle:last-child {
  fill: url(#networkStroke);

  opacity: 0.95;
}

@keyframes corePulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

.network-node circle {
  fill: #0b1d37;

  stroke: #2563eb;

  stroke-width: 2;
}

.network-node text {
  fill: rgba(255, 255, 255, 0.75);

  font-family: Inter, sans-serif;

  font-size: 14px;

  letter-spacing: 0.15em;
}

.network-node {
  animation: nodeFloat 8s ease-in-out infinite;
}

.network-node.finance {
  animation-delay: 0s;
}

.network-node.inventory {
  animation-delay: 0.8s;
}

.network-node.hr {
  animation-delay: 1.4s;
}

.network-node.people {
  animation-delay: 2s;
}

.network-node.manufacturing {
  animation-delay: 2.6s;
}

.network-node.analytics {
  animation-delay: 3.2s;
}

.network-node.procurement {
  animation-delay: 3.8s;
}

.network-node.payroll {
  animation-delay: 4.4s;
}

@keyframes nodeFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

/*=========================================================
    FLOATING MODULE CARDS
=========================================================*/

.floating-modules {
  position: absolute;

  inset: 0;

  pointer-events: none;

  z-index: 5;
}

.module-card {
  position: absolute;

  width: 210px;

  padding: 18px 22px;

  border-radius: 18px;

  background: rgba(255, 255, 255, 0.05);

  border: 1px solid rgba(255, 255, 255, 0.08);

  backdrop-filter: blur(16px);

  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);

  animation: moduleFloat 10s ease-in-out infinite;
}

.module-title {
  display: block;

  font-size: 16px;

  font-weight: 700;

  margin-bottom: 6px;
}

.module-meta {
  display: block;

  color: var(--muted);

  font-size: 13px;
}

.module-card.finance {
  left: 8%;

  top: 14%;
}

.module-card.inventory {
  left: 10%;

  bottom: 18%;

  animation-delay: 1s;
}

.module-card.people {
  right: 8%;

  top: 18%;

  animation-delay: 2s;
}

.module-card.hr {
  right: 14%;

  bottom: 12%;

  animation-delay: 3s;
}

.module-card.analytics {
  right: 24%;

  top: 58%;

  animation-delay: 4s;
}

.module-card.manufacturing {
  left: 24%;

  top: 60%;

  animation-delay: 5s;
}

@keyframes moduleFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }

  50% {
    transform: translateY(-15px) rotate(0.8deg);
  }
}

/*=========================================================
    ALERTS
=========================================================*/

.alert {
  border-radius: 14px;

  padding: 16px 18px;

  margin-bottom: 22px;

  font-size: 14px;

  border: 1px solid transparent;
}

.alert.success {
  background: rgba(34, 197, 94, 0.12);

  border-color: rgba(34, 197, 94, 0.25);
}

.alert.error {
  background: rgba(239, 68, 68, 0.12);

  border-color: rgba(239, 68, 68, 0.25);
}

.alert.warning {
  background: rgba(245, 158, 11, 0.12);

  border-color: rgba(245, 158, 11, 0.25);
}

.alert.info {
  background: rgba(37, 99, 235, 0.12);

  border-color: rgba(37, 99, 235, 0.25);
}

/*=========================================================
    FORM
=========================================================*/

.login-form {
  width: 100%;
}

.form-group {
  margin-bottom: 22px;
}

.floating-field {
  position: relative;
}

.floating-field input {
  width: 100%;

  height: 64px;

  border-radius: 18px;

  border: 1px solid rgba(255, 255, 255, 0.1);

  background: rgba(255, 255, 255, 0.04);

  color: white;

  outline: none;

  padding: 26px 62px 8px 58px;

  transition: all 0.3s;
}

.floating-field input:focus {
  border-color: 0;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.floating-field label {
  position: absolute;

  left: 20px;

  top: 18px;

  display: flex;

  align-items: center;

  gap: 12px;

  color: var(--muted);

  transition: 0.25s;

  pointer-events: none;
}

.field-icon {
  width: 22px;

  height: 22px;
}

.field-icon svg {
  width: 22px;

  height: 22px;
}

.floating-field input:focus + label,
.floating-field input:not(:placeholder-shown) + label {
  transform: translateY(-11px) scale(0.82);

  color: #7cc4ff;
}

.password-toggle {
  position: absolute;

  right: 18px;

  top: 20px;

  width: 24px;

  height: 24px;

  background: none;

  border: none;

  color: var(--muted);
}

.password-toggle svg {
  width: 22px;

  height: 22px;
}

.caps-lock-warning {
  display: none;

  margin-top: 10px;

  color: #fbbf24;

  font-size: 13px;
}

/*=========================================================
    OPTIONS
=========================================================*/

.form-options {
  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 30px;
}

.remember-me {
  display: flex;

  align-items: center;

  gap: 10px;

  cursor: pointer;
}

.remember-me input {
  accent-color: var(--primary);
}

.remember-text {
  font-size: 14px;

  color: var(--muted);
}

.forgot-link {
  color: #7cc4ff;

  font-size: 14px;
}

.forgot-link:hover {
  color: white;
}

/*=========================================================
    BUTTON
=========================================================*/

.login-button {
  position: relative;

  width: 100%;

  height: 66px;

  border: none;

  border-radius: 20px;

  overflow: hidden;

  color: white;

  font-size: 16px;

  font-weight: 700;

  background: none;
}

.button-background {
  position: absolute;

  inset: 0;

  background: linear-gradient(135deg, #2563eb, #7c3aed, #06b6d4);

  background-size: 300%;

  animation: gradientShift 8s linear infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0%;
  }

  100% {
    background-position: 300%;
  }
}

.button-content {
  position: relative;

  z-index: 2;

  display: flex;

  justify-content: center;

  align-items: center;

  gap: 14px;

  height: 100%;
}

.button-content svg {
  width: 20px;
  height: 20px;
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 60px rgba(37, 99, 235, 0.35);
}

.loading-state {
  display: none;
}

/*=========================================================
    STATUS
=========================================================*/

.workspace-status {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 16px #22c55e;
}

/*=========================================================
    SECURITY FOOTER
=========================================================*/

.security-footer {
  margin-top: 35px;

  padding-top: 25px;

  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.security-item {
  display: flex;

  align-items: center;

  gap: 12px;

  margin-bottom: 12px;

  color: var(--muted);

  font-size: 13px;
}

.security-item .indicator {
  width: 8px;

  height: 8px;

  border-radius: 50%;

  background: #22c55e;
}

/*=========================================================
    TRUST BAR
=========================================================*/

.trust-bar {
  position: absolute;

  bottom: 56px;

  left: 50%;

  transform: translateX(-50%);

  display: flex;

  gap: 34px;

  color: rgba(255, 255, 255, 0.55);

  font-size: 13px;

  letter-spacing: 0.08em;

  z-index: 50;
}

/*=========================================================
    FOOTER
=========================================================*/

.page-footer {
  position: absolute;

  bottom: 18px;

  left: 50%;

  transform: translateX(-50%);

  display: flex;

  gap: 20px;

  color: rgba(255, 255, 255, 0.35);

  font-size: 12px;

  z-index: 50;
}

/*=========================================================
    RESPONSIVE
=========================================================*/

@media (max-width: 1200px) {
  .floating-modules,
  .business-network {
    display: none;
  }
  .trust-bar {
    display: none;
  }
}

@media (max-width: 768px) {
  .authentication-layer {
    padding: 25px;
  }

  .login-card {
    width: 100%;
    padding: 34px;
    border-radius: 24px;
  }

  .login-header h1,
  .login-header p {
    display: none;
  }

  .foot-slogan,
  .foot-version {
    display: none;
  }

  .page-footer {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}
