/* AMT Journal — base: reset, tipografía, botones, campos y utilidades compartidas (auth + app). */
@import url("tokens.css");

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "cv11" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(61, 123, 255, .3); }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
img, svg { display: block; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible { outline: 2px solid rgba(61, 123, 255, .7); outline-offset: 2px; }

/* scrollbars discretos */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .12) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .2); background-clip: content-box; border: 3px solid transparent; }

/* ---------- tipografía ---------- */
.h1 { font-size: 26px; font-weight: 600; letter-spacing: -.035em; line-height: 1.15; }
.h2 { font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
.h3 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.dim { color: var(--text-2); }
.faint { color: var(--text-3); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.warn { color: var(--warn); }
.blue { color: var(--blue); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "cv11" 1, "ss01" 1; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
/* etiqueta técnica en mayúsculas (captions de cards, cabeceras de tabla) */
.cap {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--text-3);
}
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  user-select: none;
  transition: background .16s, border-color .16s, color .16s, box-shadow .2s, transform .16s;
}
.btn:hover { background: rgba(255, 255, 255, .07); border-color: var(--line-strong); }
.btn:active { transform: translateY(.5px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn svg { flex: none; }

/* CTA principal: blanco sólido */
.btn-primary {
  background: #f4f4f5;
  border-color: #f4f4f5;
  color: #0a0a0c;
  font-weight: 600;
}
.btn-primary:hover { background: #fff; border-color: #fff; box-shadow: 0 0 24px rgba(255, 255, 255, .16); }

/* CTA con halo azul (botón de los mockups de acceso) */
.btn-glow {
  background:
    linear-gradient(90deg, rgba(47, 107, 255, .16), rgba(47, 107, 255, .03) 38%, transparent 62%),
    #05060a;
  border-color: rgba(72, 126, 255, .8);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(47, 107, 255, .12), 0 0 22px rgba(47, 107, 255, .2), inset 0 0 18px rgba(47, 107, 255, .05);
}
.btn-glow:hover {
  background:
    linear-gradient(90deg, rgba(47, 107, 255, .24), rgba(47, 107, 255, .06) 45%, transparent 75%),
    #05060a;
  border-color: rgba(110, 156, 255, .95);
  box-shadow: 0 0 0 1px rgba(47, 107, 255, .2), 0 0 34px rgba(47, 107, 255, .32), inset 0 0 22px rgba(47, 107, 255, .08);
}

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); border-color: transparent; color: var(--text); }

.btn-danger { color: var(--neg); border-color: var(--neg-line); background: var(--neg-soft); }
.btn-danger:hover { background: rgba(240, 97, 109, .18); border-color: rgba(240, 97, 109, .5); }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-sm); gap: 6px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14px; border-radius: 10px; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn-block { width: 100%; }

/* ---------- campos ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field .err { font-size: 12px; color: var(--neg); }

.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.textarea { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: rgba(61, 123, 255, .65);
  box-shadow: 0 0 0 3px rgba(61, 123, 255, .14);
}
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: rgba(240, 97, 109, .6); }
.input:disabled, .select:disabled, .textarea:disabled, .input[readonly] { color: var(--text-3); background: rgba(255, 255, 255, .02); border-color: var(--line-soft); cursor: not-allowed; }
.input[readonly] { cursor: default; }
.input[type="number"] { font-variant-numeric: tabular-nums; }
.input[type="number"]::-webkit-inner-spin-button { opacity: .25; }
.input[type="date"]::-webkit-calendar-picker-indicator,
.input[type="time"]::-webkit-calendar-picker-indicator,
.input[type="datetime-local"]::-webkit-calendar-picker-indicator { filter: invert(.6); cursor: pointer; }

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236c6f79' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}
.select option { background: #101014; color: var(--text); }

/* input con prefijo/sufijo */
.input-group { position: relative; display: flex; align-items: center; }
.input-group > .affix {
  position: absolute; left: 12px;
  color: var(--text-3); font-size: 13px; pointer-events: none;
}
.input-group > .affix.end { left: auto; right: 12px; }
.input-group > .affix ~ .input { padding-left: 28px; }
.input-group > .affix.end ~ .input { padding-left: 12px; padding-right: 34px; }

/* checkbox / switch */
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; }
.check input {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; flex: none;
  border: 1px solid var(--line-strong); border-radius: 5px;
  background: var(--inset);
  display: grid; place-content: center;
  transition: background .15s, border-color .15s;
  cursor: pointer;
}
.check input:checked { background: var(--blue); border-color: var(--blue); }
.check input:checked::after {
  content: ""; width: 9px; height: 5px;
  border-left: 1.8px solid #fff; border-bottom: 1.8px solid #fff;
  transform: translateY(-1px) rotate(-45deg);
}
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.switch input { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 20px; background: rgba(255, 255, 255, .1); border: 1px solid var(--line); transition: background .2s; cursor: pointer; flex: none; position: relative; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #c9ccd3; transition: transform .2s var(--ease), background .2s; }
.switch input:checked { background: var(--blue-600); border-color: transparent; }
.switch input:checked::after { transform: translateX(14px); background: #fff; }

/* ---------- logo ---------- */
.logo-mark { display: inline-block; color: var(--text); }
.logo-mark.glow { filter: drop-shadow(0 0 6px rgba(255, 255, 255, .5)) drop-shadow(0 0 18px rgba(255, 255, 255, .16)); }

/* ---------- animación de entrada ---------- */
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .18); border-top-color: #fff; animation: spin .7s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
