/* ============================================================
   Qubi — Acceso y registro
   Paleta tomada del logo: navy #292760, ámbar #DF922F, gris #6D6E70
   ============================================================ */

:root {
  --navy-900: #1C1B44;
  --navy-800: #292760;
  --navy-600: #3F3C82;
  --amber-500: #DF922F;
  --amber-600: #C97D1E;
  --paper: #FAFAF9;
  --ink: #1C1B2E;
  --line: #E4E3EA;
  --slate: #6D6E70;
  --danger: #8C2E22;
  --danger-bg: #FBEAE8;
  --danger-line: #F3C8C2;
  --success: #1E5E33;
  --success-bg: #E9F5EC;
  --success-line: #BFE3CA;
  --info: #2C2A63;
  --info-bg: #EEF0FA;
  --info-line: #D6D8F0;

  --font-display: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout general (dos columnas) ---------- */
.auth-shell {
  min-height: 100vh;
  display: flex;
}

/* ---------- Columna izquierda: marca ---------- */
.auth-brand {
  position: relative;
  flex: 0 0 42%;
  background: linear-gradient(165deg, var(--navy-900), var(--navy-800));
  color: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.auth-brand__grid {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 64px);
  -webkit-mask-image: radial-gradient(circle at 30% 30%, black 0%, transparent 72%);
  mask-image: radial-gradient(circle at 30% 30%, black 0%, transparent 72%);
}

.auth-brand__mark {
  position: absolute;
  top: 20%;
  right: 16%;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 13px solid var(--amber-500);
  opacity: 0.85;
}

.auth-brand__mark::after {
  content: "";
  position: absolute;
  top: 190px;
  left: 70px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid rgba(223, 146, 47, 0.3);
}

.auth-brand__content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 56px;
  display: flex;
  flex-direction: column;
  gap: 110px;
}

.auth-brand__logo {
  display: block;
  height: 42px;
  width: 107px;
  /* proporción fija del archivo (480x189 = 2.54:1) */
  object-fit: contain;
  object-position: left center;
}

.auth-brand__copy {
  max-width: 360px;
}

.auth-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--amber-500);
  display: inline-block;
  margin-bottom: 14px;
}

.auth-headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1.18;
  margin: 0 0 14px;
}

.auth-sub {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
}

/* ---------- Columna derecha: formulario ---------- */
.auth-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-card__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--amber-600);
  text-transform: uppercase;
}

.auth-card__title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  margin: 8px 0 6px;
  color: var(--navy-800);
}

.auth-card__desc {
  font-size: 14px;
  color: var(--slate);
  margin: 0 0 28px;
  line-height: 1.5;
}

/* ---------- Campos ---------- */
.field {
  margin-bottom: 20px;
}

.field__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 8px;
}

.field__label::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid var(--line);
  transition: border-top-color 0.15s ease;
}

.field:focus-within .field__label::before {
  border-top-color: var(--amber-500);
}

.field__input {
  width: 100%;
  border: none;
  border-bottom: 1.5px solid var(--line);
  background: transparent;
  padding: 10px 2px;
  font-size: 15px;
  font-family: var(--font-body);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}

.field__input::placeholder {
  color: #B6B5C0;
}

.field__input:focus {
  border-bottom-color: var(--amber-500);
  border-bottom-width: 2px;
}

.field__input:focus-visible {
  outline: none;
}

.field__hint {
  font-size: 12px;
  color: var(--slate);
  margin-top: 6px;
}

.field__row {
  display: flex;
  gap: 16px;
}

.field__row .field {
  flex: 1;
}

.password-toggle-wrap {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 2px;
  top: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1px;
  color: var(--slate);
}

.password-toggle:hover {
  color: var(--navy-800);
}

/* ---------- Botones ---------- */
.btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 13px 20px;
  background: var(--navy-800);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  background: var(--navy-600);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn__mark {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid var(--amber-500);
  transition: transform 0.15s ease;
}

.btn:hover .btn__mark {
  transform: translateX(3px);
}

.auth-foot {
  margin-top: 24px;
  font-size: 13.5px;
  color: var(--slate);
  text-align: center;
}

.auth-foot a {
  color: var(--navy-800);
  font-weight: 600;
  text-decoration: none;
}

.auth-foot a:hover {
  text-decoration: underline;
}

/* ---------- Alertas ---------- */
.alert {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  margin-bottom: 20px;
  border: 1px solid transparent;
  line-height: 1.5;
}

.alert--error {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-line);
}

.alert--success {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success-line);
}

.alert--info {
  background: var(--info-bg);
  color: var(--info);
  border-color: var(--info-line);
}

/* ---------- Código de verificación (OTP) ---------- */
.otp {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 8px;
}

.otp__input {
  width: 44px;
  height: 56px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 22px;
  color: var(--navy-800);
  border: none;
  border-bottom: 2px solid var(--line);
  border-radius: 6px 6px 0 0;
  background: #F1F0F6;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.otp__input:focus {
  border-bottom-color: var(--amber-500);
  background: #EAE8F3;
}

.otp__input:focus-visible {
  outline: none;
}

.resend {
  font-size: 13px;
  color: var(--slate);
  text-align: center;
  margin-top: 16px;
  line-height: 1.6;
}

.resend button {
  background: none;
  border: none;
  padding: 0;
  color: var(--navy-800);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
}

.resend button:disabled {
  color: #B6B5C0;
  cursor: default;
}

/* ---------- Página interna (dashboard) ---------- */
.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: var(--navy-800);
}

.app-topbar img {
  display: block;
  height: 32px;
  width: 81px;
  /* misma proporción fija (480x189 = 2.54:1) */
  object-fit: contain;
  object-position: left center;
}

.app-topbar a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  text-transform: uppercase;
}

.app-topbar a:hover {
  color: #fff;
}

.app-main {
  min-height: calc(100vh - 62px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.app-card {
  max-width: 480px;
  text-align: center;
}

.app-card__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--amber-600);
  text-transform: uppercase;
}

.app-card__title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: var(--navy-800);
  margin: 10px 0 12px;
}

.app-card__desc {
  color: var(--slate);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 28px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .auth-shell {
    flex-direction: column;
  }

  .auth-brand {
    flex: none;
    min-height: 140px;
  }

  .auth-brand__content {
    padding: 20px 28px;
    gap: 0;
    justify-content: center;
  }

  .auth-brand__copy {
    display: none;
  }

  .auth-brand__mark {
    display: none;
  }

  .auth-panel {
    align-items: flex-start;
    padding: 32px 20px 48px;
  }
}

@media (max-width: 480px) {
  .field__row {
    flex-direction: column;
    gap: 0;
  }

  .otp__input {
    width: 40px;
    height: 50px;
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

:focus-visible {
  outline: 2px solid var(--amber-500);
  outline-offset: 2px;
}