:root {
  --brand: #c8102e;
  --brand-dark: #9f0d25;
  --ink: #202b30;
  --muted: #68777f;
  --line: #d8e0e3;
  --surface: #fff;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #172126;
}

* { box-sizing: border-box; }
body { position: relative; z-index: 0; min-width: 320px; min-height: 100vh; margin: 0; overflow-x: hidden; background: #10181c url("/assets/acceso-iot-industrial-v2.webp") center / cover fixed no-repeat; }
body::before { content: ""; position: fixed; z-index: -1; inset: 0; background: linear-gradient(90deg,rgba(12,20,24,.86) 0%,rgba(12,20,24,.66) 27%,rgba(12,20,24,.23) 55%,rgba(12,20,24,.68) 78%,rgba(12,20,24,.84) 100%); }
body::after { content: ""; position: fixed; z-index: -1; inset: 0; background: linear-gradient(180deg,rgba(8,14,17,.3),transparent 25%,transparent 67%,rgba(8,14,17,.72)); }
button, input, textarea { font: inherit; }
.hidden { display: none !important; }
.login-shell { width: min(1440px, calc(100% - 56px)); min-height: 100vh; margin: 0 auto; display: grid; grid-template-columns: minmax(0,760px) minmax(390px,420px); align-items: center; justify-content: space-between; gap: clamp(42px,5vw,76px); padding: 26px 0; }
.login-intro { position: relative; width: 100%; min-height: calc(100vh - 52px); display: flex; flex-direction: column; color: #fff; }
.login-header { position: relative; z-index: 2; width: fit-content; max-width: 100%; height: 76px; display: flex; align-items: stretch; gap: 9px; }
.login-brand { flex: 0 0 205px; display: flex; align-items: center; }
.login-brand img { width: 100%; height: 76px; padding: 6px 13px; object-fit: contain; background: #fff; border-radius: 4px; box-shadow: 0 10px 35px rgba(0,0,0,.24); }
.login-title-block { min-width: 0; width: fit-content; max-width: calc(100% - 214px); flex: 0 1 auto; display: flex; flex-direction: column; justify-content: center; padding: 0 18px; background: rgba(10,24,29,.82); border: 1px solid rgba(98,217,229,.24); border-left: 3px solid #e43250; border-radius: 3px; box-shadow: 0 10px 35px rgba(0,0,0,.18),inset 0 0 24px rgba(42,174,190,.035); backdrop-filter: blur(12px); }
.eyebrow { margin: 0 0 9px; color: #ff637d; font-size: 11px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.login-title-block h1 { margin: 0; font-size: clamp(21px,1.8vw,26px); line-height: 1.05; letter-spacing: -.025em; white-space: nowrap; text-shadow: 0 3px 16px rgba(0,0,0,.28); }
.login-title-block p { margin: 8px 0 0; color: #c9e0e3; font-size: 10px; font-weight: 650; letter-spacing: .02em; }
.system-flow { position: relative; z-index: 2; width: 100%; max-width: 720px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-top: auto; padding: 16px 10px; overflow: hidden; background: rgba(7,25,32,.82); border: 1px solid rgba(91,211,224,.3); box-shadow: 0 12px 36px rgba(0,0,0,.24),inset 0 0 30px rgba(41,176,192,.045); backdrop-filter: blur(12px); }
.system-flow::before { content: ""; position: absolute; top: 0; right: 0; left: 0; height: 2px; background: linear-gradient(90deg,#e43250 0%,#c74c72 32%,#54d4df 68%,#30b8c8 100%); }
.system-flow article { min-width: 0; min-height: 58px; display: grid; grid-template-columns: 22px 31px minmax(0,1fr); align-items: center; gap: 8px; padding: 0 12px; }
.system-flow article + article { border-left: 1px solid rgba(91,211,224,.18); }
.system-flow small { color: #ff7088; font-size: 10px; font-weight: 850; letter-spacing: .04em; }
.system-flow svg { width: 28px; height: 28px; fill: none; stroke: #59d5df; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(89,213,223,.16)); }
.system-flow strong, .system-flow div > span { display: block; }
.system-flow strong { color: #f0fbfc; font-size: 12px; line-height: 1.2; }
.system-flow div > span { margin-top: 5px; overflow-wrap: anywhere; color: #bcd5d9; font-size: 9px; line-height: 1.3; }
.login-card { position: relative; min-height: 520px; display: grid; align-content: center; padding: 68px clamp(34px,4vw,46px) 48px; background: rgba(255,255,255,.975); border-top: 4px solid var(--brand); border-radius: 2px; box-shadow: 0 28px 80px rgba(5,12,15,.42); }
.card-heading { position: absolute; top: 0; right: 0; left: 0; height: 46px; display: flex; align-items: center; gap: 9px; padding: 0 22px; color: #64747b; background: #f4f6f7; border-bottom: 1px solid #e1e6e8; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.card-heading-mark { width: 8px; height: 8px; background: var(--brand); border-radius: 50%; box-shadow: 0 0 0 4px rgba(200,16,46,.1); }
.login-card .eyebrow { margin: 0 0 8px; color: var(--brand); }
.login-card h2 { margin: 0; font-size: 31px; letter-spacing: -.02em; }
.form-help, #blockedPanel p { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.field { display: grid; gap: 7px; margin-top: 18px; }
.field > label, .field > span:first-child { color: #33444b; font-size: 12px; font-weight: 750; }
.field input { width: 100%; height: 47px; padding: 0 13px; color: var(--ink); background: #fbfcfc; border: 1px solid #b8c5ca; border-radius: 3px; outline: 0; }
.field input:hover { border-color: #93a4ab; }
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(200,16,46,.09); }
.password-input { position: relative; display: block; }
.password-input input { padding-right: 78px; }
.password-input button { position: absolute; top: 5px; right: 5px; height: 37px; padding: 0 10px; color: #52656d; background: #eef2f3; border: 0; border-radius: 2px; font-size: 10px; font-weight: 800; cursor: pointer; }
.password-input button:hover, .password-input button:focus-visible { color: var(--brand); background: #f8e9ec; outline: 0; }
.password-help { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.form-error { margin: 15px 0 0; padding: 11px 13px; color: #8d1428; background: #fff0f2; border-left: 3px solid var(--brand); font-size: 12px; }
.button { width: 100%; min-height: 47px; display: grid; place-items: center; margin-top: 22px; color: #fff; background: var(--brand); border: 0; border-radius: 3px; box-shadow: 0 7px 18px rgba(200,16,46,.17); font-weight: 800; text-decoration: none; cursor: pointer; transition: background .18s ease,transform .18s ease; }
.button:hover { background: var(--brand-dark); transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.login-secondary-link { display: block; width: fit-content; margin: 15px auto 0; color: #596b73; font-size: 11px; font-weight: 750; text-decoration: none; }
.login-secondary-link:hover, .login-secondary-link:focus-visible { color: var(--brand); text-decoration: underline; }
.form-success { margin: 16px 0 0; padding: 12px 14px; color: #175d45; background: #edf9f4; border-left: 3px solid #23835f; font-size: 12px; line-height: 1.5; }
.login-support { position: absolute; right: 38px; bottom: 18px; left: 38px; margin: 0; color: #87949a; font-size: 9px; text-align: center; }
.loading-panel { color: var(--muted); text-align: center; }

@media (max-width: 1000px) {
  body { background-position: 43% top; }
  body::before { background: linear-gradient(180deg,rgba(14,23,27,.83) 0,rgba(14,23,27,.5) 44%,rgba(14,23,27,.94) 100%); }
  .login-shell { width: min(720px,calc(100% - 34px)); grid-template-columns: 1fr; gap: 28px; padding: 24px 0 38px; }
  .login-intro { min-height: 470px; }
  .login-header { width: 100%; }
  .login-title-block { flex: 1; }
  .system-flow { margin-right: auto; margin-left: auto; }
  .login-card { min-height: 510px; }
}

@media (max-width: 620px) {
  body { background-attachment: scroll; background-position: 39% top; }
  .login-shell { width: min(100% - 20px,470px); gap: 18px; padding: 12px 0 max(24px,env(safe-area-inset-bottom)); }
  .login-intro { min-height: 0; }
  .login-header { height: 76px; gap: 6px; }
  .login-brand { flex-basis: 116px; }
  .login-brand img { height: 76px; padding: 6px 7px; }
  .login-title-block { max-width: calc(100% - 122px); padding: 0 9px; }
  .login-title-block h1 { font-size: clamp(16px,4.5vw,18px); line-height: 1.08; white-space: normal; }
  .login-title-block p { margin-top: 6px; font-size: 9px; line-height: 1.25; }
  .system-flow { grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 12px; padding: 6px; }
  .system-flow article { min-height: 58px; grid-template-columns: 16px 25px minmax(0,1fr); gap: 6px; padding: 5px 7px; }
  .system-flow article + article { border-left: 0; }
  .system-flow article:nth-child(even) { border-left: 1px solid rgba(255,255,255,.14); }
  .system-flow article:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.14); }
  .system-flow svg { width: 25px; height: 25px; }
  .system-flow strong { font-size: 11px; }
  .system-flow div > span { font-size: 9px; }
  .login-card { min-height: 0; padding: 63px 22px 48px; }
  .login-card h2 { font-size: 27px; }
  .login-support { right: 24px; left: 24px; }
}

@media (max-width: 380px) {
  .login-header { height: 70px; }
  .login-brand { flex-basis: 104px; }
  .login-brand img { height: 70px; }
  .login-title-block { max-width: calc(100% - 110px); }
  .login-title-block h1 { font-size: 15px; }
  .login-title-block p { font-size: 8px; }
  .system-flow small { display: none; }
  .system-flow article { grid-template-columns: 24px minmax(0,1fr); }
  .login-card { padding-inline: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition: none; }
}
