/* ============================================================
   CLAPXSE — Estilos base
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Exo+2:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0A0A0F;
  --bg-elevated: #16161d;
  --bg-input: #1c1c26;
  --border: #2a2a36;
  --text: #f5f5f7;
  --text-muted: #9a9aa8;
  --text-faint: #6a6a78;
  --violet: #7C3AED;
  --blue: #3882F6;
  --pink: #EC4899;
  --accent: #EC4899;       /* rosa neón, usado para acentos sólidos (likes, focos, etc.) */
  --accent-hover: #d63d85;
  --accent-soft: rgba(236, 73, 153, 0.14);
  --brand-gradient: linear-gradient(90deg, var(--blue), var(--violet) 55%, var(--pink));
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 14px;
  --radius-sm: 8px;
  --font: 'Sora', 'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  /* Evita que un toque prolongado abra el menú nativo de
     "Copiar / Compartir" del navegador, para que la app se
     sienta como una app y no como una página web de texto. */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Los campos donde el usuario SÍ debe poder seleccionar y pegar
   texto (inputs, textareas y cualquier elemento marcado como
   editable) quedan exceptuados de la regla de arriba. */
input,
textarea,
[contenteditable="true"],
.selectable-text {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea {
  font-family: inherit;
  color: var(--text);
}

svg {
  display: block;
}

/* ------------------------------------------------------------
   Layout genérico para pantallas de autenticación
   ------------------------------------------------------------ */
.auth-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 24px;
  max-width: 420px;
  margin: 0 auto;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 36px;
}

.auth-brand img {
  height: 34px;
  width: auto;
}

.auth-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus {
  border-color: var(--accent);
}

.field-hint {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 5px;
}

.field-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
  display: none;
}

.field.has-error input {
  border-color: var(--danger);
}

.field.has-error .field-error {
  display: block;
}

.btn-primary {
  width: 100%;
  background: var(--brand-gradient);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  margin-top: 8px;
  transition: filter 0.15s, opacity 0.15s;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-secondary-outline {
  width: 100%;
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

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

.btn-primary .spinner {
  display: none;
}

.btn-primary.is-loading .btn-label {
  visibility: hidden;
}

.btn-primary.is-loading .spinner {
  display: block;
  position: absolute;
}

.btn-primary {
  position: relative;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-footer {
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--accent);
  font-weight: 600;
}

.auth-link-row {
  text-align: right;
  margin: -8px 0 18px;
}

.auth-link-row a {
  font-size: 13px;
  color: var(--text-muted);
}

.form-message {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.form-message.is-visible {
  display: block;
}

.form-message.is-error {
  background: rgba(239, 68, 68, 0.12);
  color: #ff8080;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.form-message.is-success {
  background: rgba(34, 197, 94, 0.12);
  color: #6ee7a0;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

/* ---------------- Barra de navegación inferior (usada en toda la app) ---------------- */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 58px;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-faint);
  font-size: 10px;
  flex: 1;
  height: 100%;
  justify-content: center;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-faint);
}

.nav-item.is-active {
  color: #fff;
}

.nav-item.is-active svg {
  stroke: var(--accent);
}

.nav-item.nav-publish .icon-circle {
  width: 42px;
  height: 30px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item.nav-publish svg {
  stroke: #fff;
  width: 20px;
  height: 20px;
}

.nav-badge {
  position: absolute;
  top: 2px;
  right: 22%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
