/*
 * El Oasis de Max — sistema de diseño (marca Triptomax).
 * CSS propio, sin build: se sirve estático y se enlaza con asset('css/oasis.css').
 * Paleta, tipografía y mascota tomadas del Brand Guidelines oficial de Triptomax.
 *   - Titulares: Ramboia Bold (uso primario).
 *   - Cuerpo/UI: PP Fraktion Sans (Regular/Medium/Bold/Black).
 *   - Mono/labels: PP Fraktion Mono.
 *   - Mascota Max: public/img/max/<emocion>.webp (22 emociones).
 */

/* ---- Tipografías de marca (self-hosted en public/fonts) ---- */
@font-face {
    font-family: 'Ramboia';
    src: url('../fonts/Ramboia-Bold.otf') format('opentype');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'PP Fraktion Sans';
    src: url('../fonts/PPFraktionSans-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'PP Fraktion Sans';
    src: url('../fonts/PPFraktionSans-Medium.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'PP Fraktion Sans';
    src: url('../fonts/PPFraktionSans-Bold.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'PP Fraktion Sans';
    src: url('../fonts/PPFraktionSans-Black.woff2') format('woff2');
    font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'PP Fraktion Mono';
    src: url('../fonts/PPFraktionMono-MediumItalic.woff2') format('woff2');
    font-weight: 500; font-style: italic; font-display: swap;
}

/* ---- Tokens de marca (Brand Guidelines: HEX oficiales) ---- */
:root {
    --magenta: #c700cc;          /* primario: botones, logo, enlaces de marca */
    --magenta-600: #a800ac;      /* estado hover/activo */
    --violeta: #a912f6;          /* destacado */
    --rosa: #faa8f1;             /* secundario: tarjetas destacadas */
    --rosa-claro: #fddcf7;       /* fondos suaves (derivado del rosa) */
    --menta: #c6fcc8;            /* secundario: verde pastel */
    --verde: #009a6f;            /* secundario: verde (texto/iconos) */
    --crema: #fff5ec;            /* primario: fondo de página */
    --tinta: #292a28;            /* destacado: negro de marca (texto) */
    --gris: #6f6f6c;             /* texto secundario */
    --linea: #efe2d6;            /* separadores sobre crema */
    --error: #c0241f;

    --radio: 14px;
    --radio-lg: 22px;
    --pill: 999px;
    --sombra: 0 6px 18px rgba(41, 42, 40, 0.10);
    --sombra-sm: 0 2px 8px rgba(41, 42, 40, 0.07);

    --font-body: 'PP Fraktion Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Ramboia', 'PP Fraktion Sans', system-ui, sans-serif;
    --font-mono: 'PP Fraktion Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --ancho: 960px;
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }

/* El atributo HTML [hidden] debe ganar a las clases de componente (p. ej. .btn
   fija display:inline-block, que si no anularía el ocultado del botón de reclamar). */
[hidden] { display: none !important; }

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

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--tinta);
    background: var(--crema);
    line-height: 1.55;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; }
h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }

a { color: var(--magenta); }
a:hover { color: var(--magenta-600); }

.marca { color: var(--magenta); }
.acento-verde { color: var(--verde); }

/* ---- Layout ---- */
.container {
    width: 100%;
    max-width: var(--ancho);
    margin: 0 auto;
    padding: 0 1.25rem;
}

main.container { flex: 1 0 auto; padding-top: 1.75rem; padding-bottom: 2.5rem; }
.container--estrecho { max-width: 460px; }

.stack > * + * { margin-top: 1rem; }

/* ---- Navegación superior ---- */
.nav {
    background: var(--crema);
    border-bottom: 1px solid var(--linea);
    position: sticky;
    top: 0;
    z-index: 20;
}
.nav__inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 64px;
    flex-wrap: wrap;
}
.nav__links {
    display: flex;
    align-items: center;
    gap: 0.35rem 1.1rem;
    margin-left: auto;
    flex-wrap: wrap;
}
.nav__link {
    text-decoration: none;
    color: var(--tinta);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.4rem 0.6rem;
    border-radius: var(--pill);
}
.nav__link:hover { color: var(--magenta); }
.nav__link--activo { background: var(--magenta); color: #fff; }
.nav__link--activo:hover { color: #fff; }
.nav__logout { display: inline; }
.nav__logout button {
    background: none; border: 0; cursor: pointer;
    font: inherit; font-weight: 600; color: var(--gris); padding: 0.4rem 0.6rem;
}
.nav__logout button:hover { color: var(--magenta); }

/* ---- Logo "El Oasis de Max" (placeholder de nube) ---- */
.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo__nube {
    background: var(--magenta);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--pill);
    font-family: var(--font-display);
    font-weight: 800;
    line-height: 1;
    text-align: center;
    box-shadow: var(--sombra-sm);
    position: relative;
}
.logo__nube small { display: block; font-size: 0.62em; font-weight: 700; }
.logo__nube b { color: #f7d6f0; }

/* ---- Botones ---- */
.btn {
    display: inline-block;
    font: inherit;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: var(--pill);
    padding: 0.7rem 1.5rem;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn--primario { background: var(--magenta); color: #fff; }
.btn--primario:hover { background: var(--magenta-600); color: #fff; }
.btn--verde { background: var(--verde); color: #fff; }
.btn--verde:hover { background: #256f52; color: #fff; }
.btn--fantasma { background: transparent; color: var(--magenta); border-color: var(--magenta); }
.btn--fantasma:hover { background: var(--magenta); color: #fff; }
.btn--bloque { display: block; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }

/* ---- Tarjetas y héroes ---- */
.card {
    background: #fff;
    border-radius: var(--radio-lg);
    padding: 1.5rem;
    box-shadow: var(--sombra);
}
.hero {
    border-radius: var(--radio-lg);
    padding: 1.75rem;
    box-shadow: var(--sombra);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}
.hero--rosa { background: var(--rosa); }
.hero--menta { background: var(--menta); }
.hero--violeta { background: var(--violeta); color: #fff; }
.hero__texto { flex: 1 1 260px; }
.hero__texto h1 { margin-top: 0; }
.hero__arte { flex: 0 0 auto; }

/* ---- Contador de respiros ---- */
.contador {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--sombra);
    text-align: center;
}
.contador__n { font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; color: var(--magenta); line-height: 1; }
.contador__t { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gris); }

/* ---- Listas de acciones (conseguir respiros) ---- */
.acciones { list-style: none; margin: 0; padding: 0; }
.acciones li {
    background: #fff;
    border-radius: var(--pill);
    box-shadow: var(--sombra-sm);
    padding: 0.85rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.acciones .accion__valor { color: var(--magenta); font-weight: 800; white-space: nowrap; }
/* Items altos (p. ej. "Invita a un amigo", con enlace y botones): radio de tarjeta, no de
   píldora — así el contenido no queda recortado por las esquinas. */
.acciones li.accion--amplia { border-radius: var(--radio-lg); align-items: flex-start; }
.nota { color: var(--gris); font-size: 0.85rem; }

/* Mini-formulario inline (canje de código promocional en el perfil). */
.promo-form { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.promo-form input {
    padding: 0.5rem 0.9rem;
    font: inherit;
    background: #fff;
    border: 2px solid var(--linea);
    border-radius: var(--pill);
    max-width: 180px;
}
.promo-form input:focus { outline: none; border-color: var(--magenta); }
.promo-form .btn { padding: 0.5rem 1.1rem; }

/* Bloque "invita a un amigo": enlace de invitación + compartir (sin JS). */
.accion-info { min-width: 0; }
.invitar { margin-top: 0.7rem; }
.invitar label { display: block; margin-bottom: 0.3rem; }
.invite-link {
    width: 100%;
    max-width: 440px;
    padding: 0.5rem 0.9rem;
    font: inherit;
    background: #fff;
    border: 2px solid var(--linea);
    border-radius: var(--pill);
    color: var(--gris);
}
.invite-link:focus { outline: none; border-color: var(--magenta); color: var(--tinta); }
.invitar__acciones { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.invitar__acciones .btn { padding: 0.5rem 1.1rem; }
.codigo {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--rosa-claro);
    border-radius: 6px;
    padding: 0.1rem 0.4rem;
    font-weight: 700;
}

/* ---- Rejilla de bloques (home, productos, recompensas) ---- */
.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 720px) {
    .grid--3, .grid--2 { grid-template-columns: 1fr; }
}

.bloque { text-align: center; }
.bloque__titulo { color: var(--verde); font-weight: 800; }
.bloque:nth-child(2) .bloque__titulo { color: var(--magenta); }
.bloque:nth-child(3) .bloque__titulo { color: var(--violeta); }

.recompensa { display: flex; gap: 1rem; align-items: flex-start; }
.recompensa .card { flex: 1; }
.reward-precio { color: var(--gris); font-size: 0.85rem; font-weight: 700; }

/* ---- Formularios ---- */
.field { margin: 0.9rem 0; }
.field > label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="tel"] {
    width: 100%;
    padding: 0.7rem 1rem;
    font: inherit;
    background: var(--rosa-claro);
    border: 2px solid transparent;
    border-radius: var(--pill);
    color: var(--tinta);
}
.field input:focus {
    outline: none;
    border-color: var(--magenta);
    background: #fff;
}
.check {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
    margin: 0.6rem 0;
    font-size: 0.92rem;
}
.check input { margin-top: 0.25rem; flex: 0 0 auto; }
.check label { font-weight: 400; }

/* ---- Avisos (flash / errores) ---- */
/* Aviso informativo/neutro (no de éxito): en esta app los status son informativos
   —"ya completaste hoy", "no disponible", "canje en Fase 2"—, así que evitamos el
   verde de éxito, que daría semántica equivocada. */
.flash {
    background: var(--rosa-claro);
    color: var(--tinta);
    border-left: 4px solid var(--magenta);
    border-radius: var(--radio);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-weight: 600;
}
.errores {
    background: #fdecec;
    color: var(--error);
    border-radius: var(--radio);
    padding: 0.75rem 1rem 0.75rem 1.75rem;
    margin-bottom: 1.25rem;
}
.errores li { margin: 0.15rem 0; }

.volver { display: inline-block; margin-top: 1.25rem; font-weight: 600; }

/* ---- Datos de perfil ---- */
.datos { list-style: none; margin: 0; padding: 0; }
.datos li {
    display: flex; justify-content: space-between; gap: 1rem;
    padding: 0.6rem 0; border-bottom: 1px solid var(--linea);
}
.datos dt, .datos .k { color: var(--gris); font-weight: 600; }
.datos .v { font-weight: 700; text-align: right; }

/* ---- Actividad de respiración ---- */
.oasis-circulo {
    width: 180px; height: 180px; border-radius: 50%;
    background: radial-gradient(circle, var(--rosa), var(--magenta));
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; text-align: center; margin: 0 auto;
    transition: transform linear; transform: scale(0.6);
}
.oasis-circulo span:first-child { font-size: 1.05rem; }
.oasis-circulo #cuenta { font-size: 2rem; }
.oasis-ciclos { color: var(--gris); text-align: center; margin-top: 1rem; }

/* ---- Mascota Max (ilustración oficial, webp) ---- */
.max { display: block; height: auto; }
.max--sm { width: 120px; }
.max--md { width: 175px; }
.max--lg { width: 240px; }

/* ---- Iconografía de marca (Estilo iconográfico) ---- */
.bloque__icono { width: 78px; height: auto; display: block; margin: 0 auto 0.6rem; transition: transform 0.2s ease; }
.bloque:hover .bloque__icono { transform: rotate(-4deg) scale(1.06); }
.producto { position: relative; }
.producto__icono { width: 54px; height: auto; position: absolute; top: 1.1rem; right: 1.2rem; }

/* ---- Efectos (micro-interacciones, acordes con la marca) ---- */
.card { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(41, 42, 40, 0.14); }

@keyframes max-flotar {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.hero .max { animation: max-flotar 4.5s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
    .hero .max { animation: none; }
    .card, .bloque__icono { transition: none; }
    .card:hover { transform: none; }
}

/* ---- Footer ---- */
.footer {
    background: var(--magenta);
    color: #fff;
    margin-top: 2rem;
    flex-shrink: 0;
}
.footer__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
}
.footer__marca { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; }
.footer__logo { height: 30px; width: auto; display: block; }
.footer__enlaces { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; list-style: none; margin: 0; padding: 0; }
.footer__enlaces a { color: #fff; text-decoration: none; font-size: 0.85rem; opacity: 0.9; }
.footer__enlaces a:hover { opacity: 1; text-decoration: underline; }
.footer__legal { width: 100%; font-size: 0.78rem; opacity: 0.85; border-top: 1px solid rgba(255,255,255,0.25); padding-top: 0.9rem; }
.footer__redes { display: flex; gap: 0.75rem; }
.footer__redes a { color: #fff; opacity: 0.9; }
