/* ============================================================
   WEB1500 · View styles — login · wizard · fields · admin
   ============================================================ */

/* ============ LOGIN ============ */
.login-wrap {
  min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 0.95fr;
}
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; } .login-aside { display: none; } }

.login-aside {
  position: relative; padding: 56px; display: flex; flex-direction: column;
  justify-content: space-between; overflow: hidden;
  border-right: 1px solid var(--line-soft);
  background:
    radial-gradient(700px 500px at 20% 10%, oklch(0.745 0.150 62 / 0.12), transparent 60%),
    var(--bg-1);
}
.login-aside .grid-deco {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, oklch(1 0 0 / 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, oklch(1 0 0 / 0.03) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(ellipse 80% 80% at 30% 30%, #000, transparent 80%);
}
.login-aside .aside-head { position: relative; }
.login-hero { position: relative; max-width: 460px; }
.login-hero h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.04; letter-spacing: -0.02em; }
.login-hero h1 em { font-style: normal; color: var(--brand-bright); }
.login-hero p { color: var(--text-2); font-size: 16px; margin-top: 18px; max-width: 40ch; }
.login-steps { position: relative; display: flex; flex-direction: column; gap: 2px; }
.login-step { display: flex; gap: 14px; align-items: flex-start; padding: 13px 0; border-top: 1px solid var(--line-soft); }
.login-step:last-child { border-bottom: 1px solid var(--line-soft); }
.login-step .n { font-family: var(--font-mono); font-size: 12px; color: var(--brand-bright); width: 26px; flex: none; padding-top: 2px; }
.login-step b { font-weight: 600; font-size: 14px; }
.login-step span { display: block; color: var(--text-3); font-size: 13px; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.login-card { width: 100%; max-width: 380px; }
.login-card > .brand { margin-bottom: 34px; }
.login-card h2 { font-size: 24px; }
.login-card .sub { color: var(--text-3); margin: 6px 0 28px; font-size: 14px; }

.field-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field-group > label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: var(--r-sm);
  background: var(--bg-0); border: 1px solid var(--line); color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .15s; font-size: 14px;
}
.input::placeholder { color: var(--text-4); }
.input:focus { outline: none; border-color: var(--brand-line); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--bg-1); }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.input-affix { position: relative; }
.input-affix .input { padding-left: 38px; }
.input-affix .pre { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-4); }

.login-actions { margin-top: 8px; }
.login-actions .btn { width: 100%; }
.login-row { display: flex; align-items: center; justify-content: space-between; margin: 14px 2px 0; font-size: 13px; color: var(--text-3); }
.login-row a { color: var(--brand-bright); text-decoration: none; }
.login-row a:hover { text-decoration: underline; }

.demo-access { margin-top: 30px; border-top: 1px dashed var(--line); padding-top: 20px; }
.demo-access .lbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-4); margin-bottom: 12px; }
.demo-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.demo-btns .btn { width: 100%; }

/* ============ APP SHELL ============ */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: 60px; flex: none;
  display: flex; align-items: center; gap: 16px; padding: 0 22px;
  background: oklch(0.190 0.007 265 / 0.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar .spacer { flex: 1; }
.save-state {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3);
  font-family: var(--font-mono); letter-spacing: .02em;
}
.save-state .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); transition: background .2s; }
.save-state.saving .dot { background: var(--warn); animation: pulse 1s infinite; }
.save-state.saved .dot { background: var(--ok); }
@keyframes pulse { 50% { opacity: .35; } }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-1); cursor: pointer; }
.user-chip:hover { border-color: var(--line-strong); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; background: linear-gradient(145deg, var(--brand-bright), var(--brand)); flex: none; }
.user-chip .nm { font-size: 13px; font-weight: 500; white-space: nowrap; line-height: 1.2; }
.user-chip .rl { font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* ============ WIZARD LAYOUT ============ */
.wizard { flex: 1; display: grid; grid-template-columns: 300px 1fr; max-width: var(--maxw); width: 100%; margin: 0 auto; }
@media (max-width: 1040px) { .wizard { grid-template-columns: 1fr; } .wiz-nav { display: none; } }

.wiz-nav {
  border-right: 1px solid var(--line-soft); padding: 26px 18px 26px 22px;
  position: sticky; top: 60px; align-self: start; height: calc(100dvh - 60px); overflow-y: auto;
}
.wiz-progress { margin-bottom: 22px; }
.wiz-progress .pct-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.wiz-progress .pct { font-family: var(--font-display); font-size: 26px; font-weight: 600; }
.wiz-progress .pct small { font-size: 13px; color: var(--text-3); font-family: var(--font-sans); font-weight: 400; }
.wiz-progress .lbl { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.bar { height: 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-bright)); transition: width .4s cubic-bezier(.2,.7,.3,1); }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.step-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 11px; border-radius: var(--r-sm);
  cursor: pointer; color: var(--text-2); transition: background .14s, color .14s; position: relative;
}
.step-item:hover { background: var(--bg-1); color: var(--text); }
.step-item.active { background: var(--bg-2); color: var(--text); }
.step-item.active::before { content: ""; position: absolute; left: -22px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-bright); }
.step-num {
  width: 26px; height: 26px; border-radius: 7px; flex: none; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; border: 1px solid var(--line); background: var(--bg-1); color: var(--text-3);
}
.step-item.active .step-num { border-color: var(--brand-line); color: var(--brand-bright); background: var(--brand-soft); }
.step-item.done .step-num { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.step-label { flex: 1; font-size: 13.5px; line-height: 1.25; }
.step-check { color: var(--ok); font-size: 14px; opacity: 0; }
.step-item.done .step-check { opacity: 1; }

/* ============ WIZARD CONTENT ============ */
.wiz-main { padding: 38px clamp(22px, 5vw, 64px) 120px; min-width: 0; }
.wiz-inner { max-width: 720px; margin: 0 auto; }
.sec-head { margin-bottom: 30px; }
.sec-head .kicker { display: block; margin-bottom: 12px; }
.sec-head h1 { font-size: clamp(26px, 3.2vw, 34px); line-height: 1.08; }
.sec-head p { color: var(--text-2); margin-top: 12px; font-size: 15.5px; max-width: 60ch; }

.subsec { margin-top: 34px; }
.subsec-title {
  display: flex; align-items: center; gap: 10px; font-family: var(--font-mono);
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3);
  margin-bottom: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
}
.subsec-title .n { color: var(--brand-bright); }

.fields { display: grid; gap: 18px; }
.fields.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .fields.two { grid-template-columns: 1fr; } }
.f-col-2 { grid-column: 1 / -1; }
.field > .flabel { font-size: 14px; font-weight: 500; margin-bottom: 8px; display: block; }
.field > .fhint { font-size: 13px; color: var(--text-3); margin: -2px 0 9px; }
.req { color: var(--brand-bright); margin-left: 2px; }

/* choice options (radio / checkbox) */
.choices { display: grid; gap: 9px; }
.choices.cols { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .choices.cols { grid-template-columns: 1fr; } }
.choice {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg-1); cursor: pointer; transition: border-color .14s, background .14s;
  font-size: 14px; user-select: none;
}
.choice:hover { border-color: var(--line-strong); background: var(--bg-2); }
.choice .box {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-strong); flex: none;
  display: grid; place-items: center; transition: all .14s; color: transparent;
}
.choice.radio .box { border-radius: 50%; }
.choice .box svg { width: 12px; height: 12px; }
.choice.checked { border-color: var(--brand-line); background: var(--brand-soft); }
.choice.checked .box { background: var(--brand); border-color: var(--brand); color: #fff; }
.choice .extra-input { margin-left: auto; }

/* color field */
.color-field { display: flex; align-items: center; gap: 10px; }
.color-sw { width: 38px; height: 38px; border-radius: var(--r-xs); border: 1px solid var(--line-strong); flex: none; background-image: linear-gradient(45deg, var(--bg-3) 25%, transparent 25%), linear-gradient(-45deg, var(--bg-3) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--bg-3) 75%), linear-gradient(-45deg, transparent 75%, var(--bg-3) 75%); background-size: 10px 10px; background-position: 0 0,0 5px,5px -5px,-5px 0; }
.choice.fixed { opacity: .8; cursor: default; }
.choice.fixed:hover { border-color: var(--line); background: var(--bg-1); }
.ico-svg { display: inline-flex; }

/* chips multi-select */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-1);
  cursor: pointer; font-size: 13.5px; transition: all .14s; user-select: none;
}
.chip:hover { border-color: var(--line-strong); }
.chip.checked { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand-bright); font-weight: 500; }

/* ============ UPLOAD DROPZONE ============ */
.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--r); padding: 26px;
  text-align: center; background: var(--bg-1); cursor: pointer; transition: all .16s;
}
.dropzone:hover { border-color: var(--brand-line); background: var(--bg-2); }
.dropzone.drag { border-color: var(--brand-bright); background: var(--brand-soft); }
.dropzone .dz-ico { width: 42px; height: 42px; margin: 0 auto 12px; border-radius: 11px; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line); color: var(--brand-bright); }
.dropzone b { font-size: 14px; font-weight: 600; }
.dropzone .dz-sub { color: var(--text-3); font-size: 12.5px; margin-top: 4px; }
.dropzone .dz-link { color: var(--brand-bright); text-decoration: underline; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin-top: 14px; }
.thumb { position: relative; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); aspect-ratio: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .file-ico { width: 100%; height: 100%; display: grid; place-items: center; color: var(--text-3); }
.thumb .meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 7px 8px; background: linear-gradient(transparent, oklch(0.12 0 0 / 0.92)); font-size: 10.5px; font-family: var(--font-mono); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb .rm { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 7px; border: none; background: oklch(0.12 0 0 / 0.7); color: #fff; cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity .14s; }
.thumb:hover .rm { opacity: 1; }
.thumb .rm:hover { background: var(--danger); }

/* asset inventory table */
.inv-table { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.inv-row { display: grid; grid-template-columns: 1fr 92px 92px; align-items: center; border-top: 1px solid var(--line-soft); }
.inv-row:first-child { border-top: none; }
.inv-row.head { background: var(--bg-2); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.inv-row > div { padding: 12px 14px; }
.inv-row .ck { text-align: center; }
.inv-row .ck-box { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-strong); display: inline-grid; place-items: center; cursor: pointer; color: transparent; transition: all .14s; }
.inv-row .ck-box.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.inv-row .ck-box.on.pending { background: var(--warn); border-color: var(--warn); }
.inv-label { font-size: 14px; }

/* ============ WIZARD FOOTER ============ */
.wiz-foot {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; height: 74px;
  display: flex; align-items: center; gap: 14px; padding: 0 clamp(22px, 5vw, 64px);
  background: oklch(0.190 0.007 265 / 0.86); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
}
.wiz-foot .inner { max-width: var(--maxw); width: 100%; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.wiz-foot .step-meta { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.wiz-foot .spacer { flex: 1; }
@media (max-width: 1040px) { .wiz-foot .step-meta { display: none; } }

/* ============ SUBMIT / DONE ============ */
.done-wrap { flex: 1; display: grid; place-items: center; padding: 40px 24px 100px; }
.done-card { max-width: 540px; text-align: center; }
.done-badge { width: 74px; height: 74px; border-radius: 20px; margin: 0 auto 24px; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.done-card h1 { font-size: 32px; }
.done-card p { color: var(--text-2); margin: 14px auto 0; max-width: 44ch; font-size: 15.5px; }
.done-summary { margin-top: 28px; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.done-stat { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.done-stat .v { font-family: var(--font-display); font-size: 26px; font-weight: 600; }
.done-stat .k { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* Color picker nativo dentro del swatch (issue #8). */
input.color-sw.color-picker {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border: 1px solid var(--line);
}
input.color-sw.color-picker::-webkit-color-swatch-wrapper { padding: 0; }
input.color-sw.color-picker::-webkit-color-swatch { border: none; border-radius: 5px; }
input.color-sw.color-picker::-moz-color-swatch { border: none; border-radius: 5px; }

/* Date picker nativo en tema oscuro (issue #9). */
.input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8);
  cursor: pointer;
  opacity: 0.7;
}
.input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* Botón "?" de ayuda contextual junto al label del wizard (issue #10). */
.flabel .help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 8px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  transition: color .14s, border-color .14s, background .14s;
}
.flabel .help-btn:hover {
  color: var(--brand-bright);
  border-color: var(--brand-line);
  background: var(--brand-soft);
}
