/* =========================================================================
   CurupiraHUB - login.css
   Tela de login: cracha corporativo grande ao fundo, formulario sobre ele.
   ========================================================================= */

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(ellipse at center, rgba(255,179,64,0.05) 0%, rgba(0,0,0,0) 60%),
    linear-gradient(180deg, #0a0c0f 0%, #14171c 100%);
  position: relative;
  overflow: hidden;
}

/* Grade de engenharia ao fundo */
.login-shell::before {
  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, 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 75%);
  pointer-events: none;
}

.login-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--rule-0);
  background: linear-gradient(180deg, #1b1f25 0%, #10141a 100%);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,0.6);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-2);
  position: relative;
  z-index: 2;
}
.login-top .brand {
  color: var(--amber-0);
  font-weight: 700;
  letter-spacing: 0.28em;
}
.login-top .brand::before {
  content: "\25A0\00a0";
  color: var(--amber-1);
}

.login-bottom {
  padding: 10px 20px;
  border-top: 1px solid var(--rule-0);
  background: linear-gradient(180deg, #10141a 0%, #0a0c0f 100%);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 2;
}

/* --------------------------------------------------------------------- */
/* Centro: cracha grande + formulario                                    */
/* --------------------------------------------------------------------- */
.login-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1;
}

/* Cordão vem do topo da tela até o crachá */
.login-stage::before {
  content: "";
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  /* altura = do topo até o centro do furo do crachá (aprox 50vh - metade badge + 20px) */
  height: calc(50vh - 220px);
  background: linear-gradient(180deg, #6b4a12 0%, #3b2a0b 100%);
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  background-image:
    repeating-linear-gradient(180deg, rgba(255,255,255,0.06) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, #6b4a12 0%, #3b2a0b 100%);
  z-index: 0;
  pointer-events: none;
}

/* Clip metálico logo acima do crachá */
.login-stage::after {
  content: "";
  position: fixed;
  top: calc(50vh - 220px);
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 22px;
  background: linear-gradient(180deg, #bfbfbf 0%, #555 50%, #2a2a2a 100%);
  border: 1px solid #111;
  border-radius: 4px 4px 2px 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 2px 0 #000;
  z-index: 3;
  pointer-events: none;
}

/* O cracha em si */
.badge {
  position: relative;
  width: 420px;
  max-width: 92vw;
  margin-top: 0;
  background:
    linear-gradient(180deg, #f1ecdc 0%, #d9d2bc 100%);
  color: #1d1a12;
  border: 2px solid #2a2a2a;
  border-radius: 8px;
  box-shadow:
    0 2px 0 #000,
    0 20px 40px rgba(0,0,0,0.6),
    inset 0 0 0 6px #ffffff,
    inset 0 0 0 7px #9a8f70;
  padding: 20px;
  z-index: 2;
  overflow: hidden;
}

/* Furo do cordao */
.badge::before {
  content: "";
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  width: 38px; height: 10px;
  background: #0a0a0a;
  border-radius: 5px;
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.2),
    0 1px 0 #fff;
}

/* 'Marca dagua' diagonal */
.badge::after {
  content: "CURUPIRA \00B7 INDUSTRIAL \00B7 HUB \00B7 CURUPIRA \00B7 INDUSTRIAL \00B7 HUB";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-28deg);
  font-family: var(--ff-mono);
  font-size: 38px;
  letter-spacing: 0.24em;
  color: rgba(28,24,16,0.06);
  font-weight: 900;
  pointer-events: none;
  white-space: nowrap;
  text-transform: uppercase;
}

.badge-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-bottom: 10px;
  border-bottom: 2px dashed #8a8267;
  position: relative;
  z-index: 1;
}
.badge-logo {
  width: 44px; height: 44px;
  background: #2a2a2a;
  color: var(--amber-0);
  display: grid; place-items: center;
  font-weight: 900;
  font-family: var(--ff-mono);
  font-size: 22px;
  border: 2px solid #000;
  box-shadow: inset 0 0 0 2px #ffcf6e;
}
.badge-brand {
  display: flex; flex-direction: column; line-height: 1;
}
.badge-brand .name {
  font-family: var(--ff-mono);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #1b1b1b;
}
.badge-brand .sub {
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #6a5f3a;
}
.badge-serial {
  margin-left: auto;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6a5f3a;
  text-align: right;
  line-height: 1.3;
}

.badge-form {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  background: rgba(255,255,255,0.55);
  border: 1px solid #a89e7e;
  padding: 14px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px #fff;
}

.badge-form .hub-label { color: #6a4b12; }
.badge-form .hub-input {
  background: #0e1013;
  color: var(--ink-0);
  border-color: #000;
}
.badge-form .hub-input::placeholder { color: #5e5a4c; }

.badge-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.badge-actions .hub-btn--primary { flex: 1; }

.badge-footer {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #5a4f2c;
}

.badge-barcode {
  height: 36px;
  background:
    repeating-linear-gradient(90deg,
      #1b1b1b 0 2px, transparent 2px 4px,
      #1b1b1b 4px 5px, transparent 5px 9px,
      #1b1b1b 9px 12px, transparent 12px 14px,
      #1b1b1b 14px 15px, transparent 15px 18px);
  width: 170px;
  border: 1px solid #1b1b1b;
  padding: 2px;
  background-color: #f7f1dd;
}

.badge-chip {
  width: 36px; height: 28px;
  background:
    linear-gradient(135deg, #d9b35a, #7a5617);
  border: 1px solid #3a2a09;
  border-radius: 3px;
  position: relative;
  margin-right: 8px;
}
.badge-chip::before, .badge-chip::after {
  content: "";
  position: absolute;
  left: 10%; right: 10%; height: 2px;
  background: #3a2a09;
}
.badge-chip::before { top: 25%; box-shadow: 0 6px 0 #3a2a09, 0 12px 0 #3a2a09; }
.badge-chip::after  { display: none; }

/* Nivel / autorizacao */
.badge-clearance {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px;
  color: #3a2a09;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.badge-clearance .bars { display: inline-flex; gap: 2px; }
.badge-clearance .bar {
  width: 8px; height: 10px; background: #3a2a09;
}
.badge-clearance .bar.off { background: #c4b688; }

/* Dica de ajuda ao lado do cracha */
.login-side {
  position: absolute;
  right: 24px;
  bottom: 24px;
  max-width: 280px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.8;
  z-index: 1;
}
.login-side .hub-kbd { font-size: 10px; }

/* Responsividade */
@media (max-width: 640px) {
  .badge { width: 100%; max-width: 360px; padding: 14px; }
  .login-side { display: none; }
}
