/* /app/ — acceso a Comando. A un lado, lo que puedes pedirle (la sección que antes vivía
   en la landing); al otro, iniciar sesión o crear cuenta. En móvil, primero el acceso y
   debajo los comandos. Mismo lenguaje visual que el panel. */
:root { --g100: #F9FAFB; --g200: #F4F6F8; --g500: #919EAB; --g600: #637381; --g800: #1C252E; --g900: #141A21; --primary: #00A76F; --primary-dark: #007867; --primary-light: #5BE49B; --error: #FF5630; }
* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; color: var(--g800); font-family: "Public Sans", Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.57; }
[hidden] { display: none !important; }
a { color: var(--primary-dark); }
.cmd-wordmark { display: inline-flex; align-items: center; gap: .05em; font-family: "Space Grotesk", "Public Sans", sans-serif; font-weight: 700; letter-spacing: -.02em; color: #fff; text-transform: lowercase; line-height: 1; text-decoration: none; font-size: 26px; }
.cmd-o { display: inline-block; width: .56em; height: .74em; border-radius: .14em; background: var(--primary); transform: translateY(.04em); animation: cmd-blink 1.6s steps(1, end) infinite; }
@keyframes cmd-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) { .cmd-o { animation: none; } }

.auth { display: grid; grid-template-columns: 1fr; min-height: 100vh; }

/* ---------- acceso ---------- */
.auth-main { display: flex; flex-direction: column; padding: 24px 20px 32px; }
.auth-brand { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.auth-brand .cmd-wordmark { color: var(--g900); }
.auth-brand a.back { font-size: 13px; color: var(--g600); text-decoration: none; }
.auth-box { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-loading { color: var(--g600); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid #DFE3E8; border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-error { color: var(--error); font-size: 14px; margin: 8px 0 0; }
.auth-foot { color: var(--g500); font-size: 12px; margin: 20px 0 0; line-height: 1.6; }
#clerk-root .cl-rootBox, #clerk-root .cl-cardBox, #clerk-root .cl-card { width: 100% !important; max-width: 100% !important; min-width: 0 !important; }
/* Clerk recorta la tarjeta, y su insignia «Last used» se dibuja fuera del borde
   del botón de Google: con overflow oculto salía cortada por la mitad. */
#clerk-root .cl-cardBox { box-shadow: none !important; overflow: visible !important; }
#clerk-root .cl-internal-b3fm6y, #clerk-root .cl-footer { background: transparent !important; }

/* ---------- lo que puedes pedirle ---------- */
.auth-side { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 100% 0%, #1F3A2E 0%, #141A21 50%, #0F1419 100%); color: #fff; padding: 32px 20px 40px; }
.auth-side::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 15% 85%, rgba(0, 167, 111, .22), transparent 40%), radial-gradient(circle at 90% 10%, rgba(91, 228, 155, .16), transparent 35%); pointer-events: none; }
.auth-side-inner { position: relative; max-width: 560px; margin: 0 auto; }
.eyebrow { font-family: ui-monospace, "JetBrains Mono", Menlo, monospace; font-size: 11px; letter-spacing: .12em; color: var(--primary-light); margin-bottom: 12px; }
.auth-side h1 { font-size: 28px; line-height: 1.2; font-weight: 700; margin: 0 0 20px; letter-spacing: -.01em; }
.auth-side .lead { color: rgba(255, 255, 255, .72); font-size: 15px; line-height: 1.6; margin: 0 0 24px; }
/* El hueco del teléfono. Va vacío en el HTML y con `hidden`: lo llena
   app/auth-phone.js, así que sin JS no queda un recuadro negro esperando. */
.auth-phone { display: none; }
.auth-phone-canvas { width: 100%; height: auto; display: block; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .45)); }
.cmd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cmd-list li { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; padding: 14px 16px; }
.cmd-list .n { font-family: ui-monospace, "JetBrains Mono", Menlo, monospace; font-size: 12px; color: var(--primary-light); background: rgba(0, 167, 111, .14); border-radius: 8px; padding: 6px 8px; line-height: 1; margin-top: 2px; }
.cmd-list h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; color: #fff; }
.cmd-list .cmd { margin: 0; color: rgba(255, 255, 255, .7); font-style: italic; font-size: 13.5px; line-height: 1.55; }
.cmd-list .cmd::before { content: "“"; } .cmd-list .cmd::after { content: "”"; }
.auth-side-foot { color: rgba(255, 255, 255, .5); font-size: 12.5px; margin-top: 24px; }
.auth-side-foot a { color: var(--primary-light); }

/* ---------- escritorio: acceso fijo a la derecha, contenido desplazable a la izquierda ---------- */
@media (min-width: 1024px) {
  .auth { grid-template-columns: minmax(0, 1.15fr) minmax(440px, 1fr); }
  .auth-side { order: 0; padding: 40px 56px 64px; }
  .auth-side .cmd-wordmark { margin-bottom: 48px; display: inline-flex; }
  .auth-side h1 { font-size: 40px; }
  .auth-phone { display: block; float: right; width: 236px; margin: -20px 0 24px 36px; shape-outside: margin-box; }
  /* El costado derecho deja aire para lo que Clerk dibuja fuera de la tarjeta. */
  .auth-main { order: 1; position: sticky; top: 0; height: 100vh; justify-content: center; padding: 40px 72px; }
  .auth-brand { position: absolute; top: 28px; right: 56px; left: 56px; }
  .auth-brand .cmd-wordmark { display: none; }
  .cmd-list { grid-template-columns: 1fr 1fr; clear: both; }
}
@media (max-width: 1023px) {
  .auth-main { order: 0; }
  .auth-side { order: 1; }
  .auth-side .cmd-wordmark { display: none; }
  .auth-side h1 { font-size: 24px; }
}
/* Entre 1024 y 1279 la columna es estrecha: con el titular a 40 px no quedaba
   sitio al lado del teléfono y el titular caía debajo. */
@media (min-width: 1024px) and (max-width: 1279px) {
  .auth-side { padding: 40px 40px 56px; }
  .auth-side h1 { font-size: 32px; }
  .auth-phone { width: 216px; margin: -12px 0 20px 28px; }
  .auth-brand { right: 40px; left: 40px; }
}
/* Entre 760 y 1023 la columna ocupa todo el ancho y el teléfono cabe al lado
   del titular. Por debajo de eso se queda fuera: a 200 px no se lee. */
@media (min-width: 760px) and (max-width: 1023px) {
  .auth-phone { display: block; float: right; width: 228px; margin: 0 0 20px 28px; shape-outside: margin-box; }
  .cmd-list { clear: both; }
}

/* El selector de idioma junto al enlace de vuelta, arriba de la caja de acceso. */
.auth-brand-right { display: inline-flex; align-items: center; gap: .75rem; margin-left: auto; }
.lang-picker { display: inline-flex; align-items: center; }
.lang-picker .lang-picker-label { display: none; }
.lang-picker select {
  appearance: none; -webkit-appearance: none;
  border: 1px solid rgba(145, 158, 171, .32); border-radius: 8px;
  background: #fff; color: #1C252E; font: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 26px 7px 10px; line-height: 1; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23637381' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; background-size: 14px;
}
.lang-picker select:hover { border-color: #1C252E; }
.lang-picker select:focus-visible { outline: 2px solid #1C252E; outline-offset: 1px; }

/* Formulario de correo y contraseña (17-sep, en lugar de Clerk). */
.auth-form { display: grid; gap: 0; }
.auth-form-title { font-size: 26px; font-weight: 700; line-height: 1.2; margin: 0 0 6px; color: var(--g900); }
.auth-form-sub { color: var(--g600); font-size: 14.5px; line-height: 1.5; margin: 0 0 22px; }
.auth-label { font-size: 13px; font-weight: 600; color: var(--g900); margin-bottom: 6px; }
.auth-input { width: 100%; box-sizing: border-box; height: 46px; padding: 0 12px; font: 400 15px/1 "Public Sans", Inter, system-ui, sans-serif; color: var(--g900); background: #fff; border: 1px solid rgba(145, 158, 171, .32); border-radius: 8px; margin-bottom: 16px; }
.auth-input:focus-visible { outline: 2px solid var(--primary, #00A76F); outline-offset: 1px; border-color: transparent; }
.auth-pass { position: relative; }
.auth-eye { position: absolute; right: 8px; top: 8px; height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--g600); font: 600 13px/1 "Public Sans", Inter, system-ui, sans-serif; cursor: pointer; }
.auth-eye:hover { color: var(--g900); background: #F4F6F8; }
.auth-submit { height: 46px; margin-top: 4px; border: 0; border-radius: 8px; background: var(--primary, #00A76F); color: #fff; font: 700 15px/1 "Public Sans", Inter, system-ui, sans-serif; cursor: pointer; }
.auth-submit:hover { background: #007867; }
.auth-submit[disabled] { opacity: .6; cursor: default; }
.auth-link { justify-self: start; margin-top: 14px; padding: 0; border: 0; background: none; color: #007867; font: 600 14px/1 "Public Sans", Inter, system-ui, sans-serif; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
.auth-ok { color: #007867; font-size: 14px; margin: 12px 0 0; }
