/*
 * Secure Hub — Login Interface Visual Upgrade
 * UI-only overrides. Existing React authentication, form handlers, API calls,
 * session logic and redirects remain untouched.
 */

body.securehub-login-ui {
  --sh-gold-light: #fff1ad;
  --sh-gold: #dfad43;
  --sh-gold-deep: #8f5010;
  --sh-cyan: #31c7ff;
  --sh-cyan-soft: rgba(49, 199, 255, 0.28);
  --sh-wood: #321408;
  --sh-wood-dark: #130603;
  --sh-ivory: #fffaf0;
  background: #030406 !important;
  overflow-x: hidden;
}

body.securehub-login-ui #root > div {
  min-height: 100svh !important;
  background:
    radial-gradient(circle at 50% 18%, rgba(32, 130, 180, 0.17), transparent 31%),
    radial-gradient(circle at 10% 76%, rgba(167, 91, 19, 0.2), transparent 29%),
    linear-gradient(145deg, #020305 0%, #0c1117 50%, #020203 100%) !important;
}

/* The old marketing/navigation column is not part of the requested login view. */
body.securehub-login-ui #root nav,
body.securehub-login-ui .wood-main-container > .wood-panel-left {
  display: none !important;
}

body.securehub-login-ui #root main.wood-login-page-bg {
  min-height: 100svh !important;
  padding: 30px 16px !important;
  align-items: center !important;
  justify-content: center !important;
  background:
    linear-gradient(rgba(39, 185, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 185, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% 28%, rgba(24, 139, 196, 0.14), transparent 37%),
    radial-gradient(circle at 15% 82%, rgba(180, 103, 28, 0.16), transparent 34%),
    #05070a !important;
  background-size: 46px 46px, 46px 46px, auto, auto, auto !important;
}

body.securehub-login-ui .wood-main-container {
  width: min(790px, calc(100vw - 32px)) !important;
  max-width: 790px !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  display: block !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 222, 130, 0.5) !important;
  border-radius: 34px !important;
  background: #190904 !important;
  box-shadow:
    0 42px 100px rgba(0, 0, 0, 0.78),
    0 0 0 4px rgba(77, 39, 8, 0.86),
    0 0 0 6px rgba(236, 181, 66, 0.78),
    0 0 42px rgba(31, 177, 255, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

body.securehub-login-ui #login-form-card {
  width: 100% !important;
  min-height: 0 !important;
  padding: 0 !important;
  display: block !important;
  background:
    linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.025) 48%, transparent 61%),
    radial-gradient(circle at 50% 0, rgba(155, 83, 23, 0.18), transparent 46%),
    repeating-linear-gradient(2deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 4px),
    linear-gradient(145deg, #351508 0%, #1c0904 54%, #100503 100%) !important;
}

body.securehub-login-ui #login-form-card > .wood-golden-inset-frame {
  position: relative !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 56px 30px !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body.securehub-login-ui #login-form-card > .wood-golden-inset-frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 0;
  border: 1px solid rgba(235, 181, 66, 0.16);
  border-radius: 23px;
  pointer-events: none;
}

body.securehub-login-ui #login-form-card > .wood-golden-inset-frame > * {
  position: relative;
  z-index: 2;
}

body.securehub-login-ui .securehub-original-login-heading {
  display: none !important;
}

/* ---------- Animated wooden security header ---------- */

.securehub-write-header {
  position: relative !important;
  isolation: isolate;
  width: auto;
  height: 300px;
  margin: 0 -56px 27px;
  overflow: hidden;
  border-bottom: 1px solid rgba(224, 172, 61, 0.75);
  background:
    radial-gradient(circle at 84% 48%, rgba(42, 182, 239, 0.16), transparent 19%),
    repeating-linear-gradient(2deg, rgba(255, 255, 255, 0.017) 0 1px, transparent 1px 5px),
    linear-gradient(112deg, rgba(255, 255, 255, 0.03), transparent 28%),
    linear-gradient(145deg, #3a180b 0%, #281006 52%, #160704 100%);
  box-shadow: inset 0 -32px 44px rgba(0, 0, 0, 0.28);
}

.securehub-write-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 24%, rgba(255, 255, 255, 0.08) 45%, transparent 58%) -140% 0 / 55% 100% no-repeat,
    radial-gradient(circle at 8% 48%, rgba(255, 194, 72, 0.06), transparent 25%);
  animation: shWoodShine 7s ease-in-out infinite;
  mix-blend-mode: screen;
}

.securehub-write-header::after {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 7;
  border: 1px solid rgba(255, 219, 123, 0.22);
  border-radius: 20px;
  pointer-events: none;
}

.sh-header-copy {
  position: absolute;
  z-index: 5;
  inset: 42px 185px 27px 47px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.sh-desk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 22px;
  color: var(--sh-gold-light);
  font: 800 16px/1 Inter, Arial, sans-serif;
  letter-spacing: 0.24em;
  white-space: nowrap;
  text-shadow: 0 1px 0 #2b1103, 0 0 11px rgba(255, 206, 84, 0.32);
}

.sh-desk-dot {
  width: 6px;
  aspect-ratio: 1;
  flex: none;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.25);
  background: #f4ca69;
  box-shadow: 0 0 12px var(--sh-cyan);
  transition: 0.35s ease;
}

.securehub-write-header.sh-desk-complete .sh-desk-dot {
  opacity: 1;
  transform: scale(1);
}

.sh-gold-rule {
  width: 0;
  height: 1px;
  margin-top: 9px;
  background: linear-gradient(90deg, #a76a1d, #ffe28a 76%, transparent);
  box-shadow: 0 0 9px rgba(40, 194, 255, 0.72);
  transition: width 0.78s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.securehub-write-header.sh-desk-complete .sh-gold-rule {
  width: 52%;
}

.sh-written-line {
  display: block;
  width: max-content;
  max-width: 100%;
  min-height: 1.04em;
  white-space: pre;
  color: #f8e7bd;
  background: linear-gradient(180deg, #fff4bb 0%, #e6b855 43%, #fff0a1 62%, #9a5b12 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 #3b1b06) drop-shadow(0 3px 2px rgba(0, 0, 0, 0.8));
}

.sh-welcome-line,
.sh-operator-line {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 0.99;
}

.sh-welcome-line {
  margin-top: 15px;
  font-size: 50px;
}

.sh-operator-line {
  margin-top: 7px;
  font-size: 31px;
}

.sh-header-subtitle {
  margin-top: auto;
  max-width: 96%;
  color: rgba(255, 248, 230, 0.92);
  font: 560 15px/1.25 Inter, Arial, sans-serif;
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(7px);
  text-shadow: 0 2px 3px #000;
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.securehub-write-header.sh-all-complete .sh-header-subtitle {
  opacity: 1;
  transform: translateY(0);
}

.sh-shield-wrap {
  position: absolute;
  z-index: 5;
  top: 38px;
  right: 39px;
  width: 132px;
  aspect-ratio: 0.82;
  filter: drop-shadow(0 8px 9px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 12px rgba(53, 192, 255, 0.28));
}

.sh-shield-svg {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
}

.sh-shield-aura {
  position: absolute;
  z-index: 0;
  inset: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(67, 203, 255, 0.48), transparent 68%);
  animation: shShieldPulse 2.6s ease-in-out infinite;
}

.sh-shield-scan {
  position: absolute;
  z-index: 3;
  left: -8%;
  top: 13%;
  width: 116%;
  height: 1px;
  opacity: 0.4;
  background: linear-gradient(90deg, transparent, #67ddff, transparent);
  filter: drop-shadow(0 0 5px #37bdff);
  animation: shShieldScan 3s ease-in-out infinite;
}

.sh-circuit-svg {
  position: absolute;
  z-index: 2;
  top: 21px;
  right: 8px;
  width: 245px;
  height: 255px;
  opacity: 0.45;
  pointer-events: none;
}

.sh-circuit-svg path,
.sh-circuit-svg circle {
  fill: none;
  stroke: #bd7c28;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sh-circuit-svg path {
  stroke-dasharray: 7 6;
  animation: shCircuitFlow 7s linear infinite;
}

.sh-login-quill {
  position: absolute;
  z-index: 12;
  left: 0;
  top: 0;
  width: 78px;
  height: auto;
  opacity: 0;
  pointer-events: none;
  transform: translate(-25%, -78%) rotate(-17deg);
  transform-origin: 20% 90%;
  transition: left 58ms linear, top 58ms linear, opacity 0.22s ease;
  filter:
    drop-shadow(0 3px 2px rgba(0, 0, 0, 0.85))
    drop-shadow(0 0 8px rgba(255, 199, 60, 0.75))
    drop-shadow(0 0 12px rgba(42, 190, 255, 0.4));
}

.sh-login-quill.sh-writing {
  opacity: 1;
  animation: shQuillBob 0.38s ease-in-out infinite alternate;
}

.sh-login-quill.sh-resting {
  opacity: 1;
  animation: shQuillRest 0.75s ease-in-out infinite alternate;
}

.sh-login-quill.sh-departing {
  opacity: 0;
  transform: translate(120%, -150%) rotate(18deg) scale(0.82);
  transition: all 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.sh-feather-svg {
  display: block;
  width: 100%;
  height: auto;
}

.sh-quill-spark {
  position: absolute;
  left: 13%;
  bottom: 2%;
  width: 7px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff3a1;
  box-shadow: 0 0 7px #ffd052, 0 0 16px #2ac7ff;
  animation: shSpark 430ms ease-out infinite;
}

.sh-cycle-indicator {
  position: absolute;
  z-index: 8;
  right: 24px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 236, 190, 0.42);
  font: 700 8px/1 Inter, Arial, sans-serif;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sh-cycle-indicator::before {
  content: "";
  width: 5px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--sh-cyan);
  box-shadow: 0 0 8px var(--sh-cyan);
  animation: shIndicator 1.1s ease-in-out infinite;
}

/* ---------- Preserve form behavior; update appearance only ---------- */

body.securehub-login-ui #login-form-card form {
  position: relative;
  z-index: 3;
}

body.securehub-login-ui #login-form-card form > div.space-y-1 + div.space-y-1 {
  margin-top: 19px !important;
}

body.securehub-login-ui #login-form-card label[for="username"],
body.securehub-login-ui #login-form-card label[for="password"] {
  display: block !important;
  margin: 0 0 8px 3px !important;
  color: #4faff2 !important;
  font: 780 10px/1 Inter, Arial, sans-serif !important;
  letter-spacing: 0.105em !important;
}

body.securehub-login-ui #login-form-card .wood-recessed-input-container {
  min-height: 61px !important;
  overflow: hidden !important;
  border: 1px solid #d29b33 !important;
  border-radius: 17px !important;
  background: linear-gradient(180deg, #fffdf5, #f1ebdd) !important;
  box-shadow:
    inset 0 0 0 2px rgba(112, 60, 10, 0.18),
    0 9px 22px rgba(0, 0, 0, 0.25),
    0 0 0 rgba(31, 185, 255, 0) !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease !important;
}

body.securehub-login-ui #login-form-card .wood-recessed-input-container:focus-within {
  border-color: #ffe28a !important;
  box-shadow:
    inset 0 0 0 2px rgba(112, 60, 10, 0.16),
    0 9px 22px rgba(0, 0, 0, 0.25),
    0 0 0 3px rgba(38, 186, 255, 0.22),
    0 0 20px rgba(38, 186, 255, 0.22) !important;
  transform: translateY(-1px);
}

body.securehub-login-ui #login-form-card .wood-recessed-input-container > div:first-child {
  align-self: stretch;
  display: grid !important;
  place-items: center;
  width: 68px;
  flex: 0 0 68px;
  padding: 0 !important;
  border-right: 1px solid #b47b21;
  color: #734211 !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(237, 226, 201, 0.55));
}

body.securehub-login-ui #login-form-card .wood-recessed-input-container input {
  min-width: 0 !important;
  min-height: 59px !important;
  padding: 0 18px !important;
  color: #2f190e !important;
  background: transparent !important;
  font: 700 15px/1 Inter, Arial, sans-serif !important;
  letter-spacing: 0.02em !important;
  -webkit-text-fill-color: #2f190e !important;
}

body.securehub-login-ui #login-form-card .wood-recessed-input-container input::placeholder {
  color: #939ba7 !important;
  font-weight: 520 !important;
  -webkit-text-fill-color: #939ba7 !important;
}

body.securehub-login-ui #login-form-card .wood-recessed-input-container button {
  right: 17px !important;
  color: #85510f !important;
}

body.securehub-login-ui #login-form-card #stay-signed-in + label {
  color: rgba(235, 231, 220, 0.75) !important;
  font-size: 12px !important;
}

body.securehub-login-ui #login-form-card #stay-signed-in {
  width: 19px !important;
  height: 19px !important;
  accent-color: #1688d0;
}

body.securehub-login-ui #login-form-card .wood-signin-btn-3d {
  position: relative !important;
  min-height: 63px !important;
  margin-top: 21px !important;
  overflow: hidden !important;
  border: 1px solid #e2aa3c !important;
  border-radius: 18px !important;
  color: #fff4d0 !important;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, 0.055), transparent 28%),
    linear-gradient(180deg, #4a210d, #281005) !important;
  box-shadow:
    inset 0 0 0 2px rgba(255, 220, 131, 0.08),
    0 0 0 2px rgba(18, 125, 215, 0.92),
    0 0 20px rgba(29, 153, 255, 0.72),
    0 12px 28px rgba(0, 0, 0, 0.45) !important;
  font: 700 22px/1 Georgia, "Times New Roman", serif !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

body.securehub-login-ui #login-form-card .wood-signin-btn-3d::before {
  content: "🔒";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 57px;
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(224, 171, 64, 0.28);
  color: #efc25e;
  background: rgba(0, 0, 0, 0.16);
  font: 18px/1 Arial, sans-serif;
}

body.securehub-login-ui #login-form-card .wood-signin-btn-3d::after {
  content: "→";
  position: absolute;
  right: 20px;
  color: #ecc057;
  font: 300 27px/1 Arial, sans-serif;
}

body.securehub-login-ui #login-form-card .wood-signin-btn-3d:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow:
    inset 0 0 0 2px rgba(255, 220, 131, 0.12),
    0 0 0 2px #1a99ff,
    0 0 30px rgba(29, 153, 255, 0.82),
    0 16px 32px rgba(0, 0, 0, 0.5) !important;
}

body.securehub-login-ui #login-form-card form + div,
body.securehub-login-ui #login-form-card form ~ div {
  position: relative;
}

body.securehub-login-ui #login-form-card form ~ button.wood-recessed-input-container {
  min-height: 58px !important;
  width: 100% !important;
  border-radius: 17px !important;
  color: #31190d !important;
  background: linear-gradient(180deg, #fffdf5, #efe4cf) !important;
  font-size: 14px !important;
  box-shadow: inset 0 0 0 2px rgba(112, 60, 10, 0.14), 0 10px 20px rgba(0, 0, 0, 0.2) !important;
}

body.securehub-login-ui #login-form-card form ~ button.wood-recessed-input-container:hover {
  transform: translateY(-1px) !important;
  box-shadow: inset 0 0 0 2px rgba(112, 60, 10, 0.14), 0 12px 24px rgba(0, 0, 0, 0.28), 0 0 17px rgba(35, 174, 234, 0.2) !important;
}

body.securehub-login-ui #login-form-card form ~ div:last-child {
  color: rgba(240, 232, 216, 0.72) !important;
}

@keyframes shWoodShine {
  0%, 40% { background-position: -140% 0, 0 0; }
  75%, 100% { background-position: 310% 0, 0 0; }
}

@keyframes shShieldPulse {
  0%, 100% { transform: scale(0.88); opacity: 0.12; }
  50% { transform: scale(1.15); opacity: 0.32; }
}

@keyframes shShieldScan {
  0%, 100% { transform: translateY(0); opacity: 0.04; }
  50% { transform: translateY(112px); opacity: 0.55; }
}

@keyframes shCircuitFlow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -78; }
}

@keyframes shQuillBob {
  from { transform: translate(-25%, -78%) rotate(-19deg); }
  to { transform: translate(-23%, -75%) rotate(-15deg); }
}

@keyframes shQuillRest {
  from { transform: translate(-25%, -78%) rotate(-16deg); }
  to { transform: translate(-23%, -80%) rotate(-20deg); }
}

@keyframes shSpark {
  0% { opacity: 1; transform: scale(0.4); }
  70% { opacity: 0.85; transform: scale(1.5); }
  100% { opacity: 0; transform: scale(0.2) translate(8px, -8px); }
}

@keyframes shIndicator {
  0%, 100% { opacity: 0.35; transform: scale(0.72); }
  50% { opacity: 1; transform: scale(1.1); }
}

@media (max-width: 720px) {
  body.securehub-login-ui #root main.wood-login-page-bg {
    align-items: flex-start !important;
    padding: 15px 9px 25px !important;
  }

  body.securehub-login-ui .wood-main-container {
    width: calc(100vw - 18px) !important;
    border-radius: 23px !important;
    box-shadow:
      0 24px 60px rgba(0, 0, 0, 0.8),
      0 0 0 3px rgba(77, 39, 8, 0.82),
      0 0 0 5px rgba(236, 181, 66, 0.72) !important;
  }

  body.securehub-login-ui #login-form-card > .wood-golden-inset-frame {
    padding: 0 18px 22px !important;
  }

  .securehub-write-header {
    height: 235px;
    margin: 0 -18px 23px;
  }

  .sh-header-copy {
    inset: 29px 114px 24px 27px;
  }

  .sh-desk-row {
    gap: 6px;
    min-height: 16px;
    font-size: clamp(8px, 2.65vw, 13px);
    letter-spacing: 0.17em;
  }

  .sh-desk-dot { width: 4px; }
  .sh-gold-rule { margin-top: 6px; }
  .sh-welcome-line { margin-top: 10px; font-size: clamp(27px, 7.1vw, 39px); }
  .sh-operator-line { margin-top: 5px; font-size: clamp(16px, 4.25vw, 23px); }
  .sh-header-subtitle { max-width: 100%; font-size: clamp(8px, 2.35vw, 11px); }

  .sh-shield-wrap {
    top: 31px;
    right: 21px;
    width: 88px;
  }

  .sh-circuit-svg {
    top: 20px;
    right: -22px;
    width: 175px;
    height: 200px;
  }

  .sh-login-quill { width: clamp(48px, 12.5vw, 65px); }
  .sh-cycle-indicator { right: 19px; bottom: 13px; font-size: 6px; }

  body.securehub-login-ui #login-form-card .wood-recessed-input-container {
    min-height: 56px !important;
    border-radius: 14px !important;
  }

  body.securehub-login-ui #login-form-card .wood-recessed-input-container > div:first-child {
    width: 54px;
    flex-basis: 54px;
  }

  body.securehub-login-ui #login-form-card .wood-recessed-input-container input {
    min-height: 54px !important;
    padding: 0 13px !important;
    font-size: 14px !important;
  }

  body.securehub-login-ui #login-form-card .wood-signin-btn-3d {
    min-height: 58px !important;
    border-radius: 15px !important;
    font-size: 20px !important;
  }

  body.securehub-login-ui #login-form-card .wood-signin-btn-3d::before { width: 49px; }
  body.securehub-login-ui #login-form-card .wood-signin-btn-3d::after { right: 16px; }
}

@media (max-width: 420px) {
  .securehub-write-header { height: 218px; }
  .sh-header-copy { inset: 27px 91px 20px 22px; }
  .sh-welcome-line { font-size: 25px; }
  .sh-operator-line { font-size: 15px; }
  .sh-shield-wrap { top: 31px; right: 15px; width: 72px; }
  .sh-circuit-svg { right: -36px; width: 148px; }
  .sh-cycle-indicator { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .securehub-write-header::before,
  .sh-shield-aura,
  .sh-shield-scan,
  .sh-circuit-svg path,
  .sh-login-quill,
  .sh-quill-spark,
  .sh-cycle-indicator::before {
    animation: none !important;
  }
}
