/* =============================================
   SetupInspire — app.css
   Secciones:
   1.  Variables & tokens
   2.  Reset
   3.  Base — tipografía
   4.  Layout
   5.  Header & nav
   6.  Botones
   7.  Forms
   8.  Cards
   9.  Listas
   10. Tablas
   11. Utilidades
   12. Media queries (tablet ≤1024 · mobile ≤768 · mobile-sm ≤480)
   ============================================= */


/* =============================================
   1. VARIABLES & TOKENS
   ============================================= */
:root {
    /* Paleta */
    --primary:      #4F46E5;
    --primary-dark: #3730A3;

    --bg:           #0F172A;
    --surface:      #1E293B;
    --surface-2:    #243249;

    --border:       rgba(255, 255, 255, 0.08);
    --border-focus: var(--primary);

    --text:         #F8FAFC;
    --text-muted:   #94A3B8;

    --success:      #10B981;
    --warning:      #F59E0B;
    --danger:       #EF4444;

    /* Radios */
    --radius-sm:  6px;
    --radius:     10px;
    --radius-lg:  16px;
    --radius-xl:  24px;

    /* Sombras */
    --shadow:     0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md:  0 4px 20px rgba(0, 0, 0, 0.45);

    /* Tipografía */
    --font:        'Plus Jakarta Sans', system-ui, sans-serif;
    --font-size:   16px;
    --line-height: 1.65;

    /* Espaciado */
    --gap:           1.5rem;
    --container-max: 1200px;
    --container-pad: 1.5rem;

    /* Transición base */
    --transition: 0.15s ease;
}


/* =============================================
   2. RESET
   ============================================= */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: var(--font-size);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: var(--line-height);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video, svg { display: block; max-width: 100%; }

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }

button, input, select, textarea { font: inherit; }

ol, ul { list-style: none; }


/* =============================================
   3. BASE — Tipografía
   ============================================= */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    letter-spacing: -0.01em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { color: var(--text-muted); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 700; color: var(--text); }
small      { font-size: 0.875rem; color: var(--text-muted); }
em, i      { font-style: italic; }

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin-block: 1.5rem;
}


/* =============================================
   4. LAYOUT
   ============================================= */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-pad);
}

.page { padding-block: 2.5rem; }

.section { margin-bottom: 3rem; }

.section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section__title {
    font-size: 1.1rem;
    font-weight: 700;
}


/* =============================================
   5. HEADER & NAV
   ============================================= */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.topbar__inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 64px;
}

.topbar__logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.topbar__logo span { color: var(--primary); }

.topbar__nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex: 1;
}

.topbar__nav a {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}

.topbar__nav a:hover,
.topbar__nav a.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.topbar__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    cursor: pointer;
}


/* =============================================
   6. BOTONES
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition), opacity var(--transition), transform 0.1s;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}

.btn:active    { transform: scale(0.97); }
.btn:disabled  { opacity: 0.45; pointer-events: none; cursor: not-allowed; }

.btn--primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn--primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

.btn--secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn--secondary:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }

.btn--ghost    { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn--ghost:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }

.btn--danger   { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--danger:hover { opacity: 0.85; }

.btn--sm  { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn--lg  { padding: 0.7rem 1.75rem; font-size: 1rem; }
.btn--full { width: 100%; }


/* =============================================
   7. FORMS
   ============================================= */
.field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.field:last-of-type { margin-bottom: 0; }

.field label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

.field-hint  { font-weight: 400; color: var(--text-muted); margin-left: 0.25rem; }
.field-error { font-size: 0.8rem; color: var(--danger); }

.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
select,
textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

input[type="file"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

input::placeholder,
textarea::placeholder { color: var(--text-muted); opacity: 0.7; }

textarea { resize: vertical; min-height: 100px; }

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394A3B8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    padding-right: 2.5rem;
}

/* Input con prefijo */
.input-prefix {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-prefix:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.input-prefix span {
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border-right: 1px solid var(--border);
    white-space: nowrap;
    flex-shrink: 0;
}

.input-prefix input {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    flex: 1;
}

.input-prefix input:focus { box-shadow: none; }

/* Checkbox */
.check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.check input[type="checkbox"] {
    width: auto;
    height: 16px;
    width: 16px;
    accent-color: var(--primary);
    border-radius: 3px;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}

.alert--success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
    color: var(--success);
}

.alert--error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--danger);
}

/* Auth layout */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem var(--container-pad);
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.auth-title {
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
}

.auth-sub {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 1.5rem;
}


/* =============================================
   8. CARDS
   ============================================= */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition);
}

.card:hover { border-color: rgba(255, 255, 255, 0.15); transform: translateY(-2px); }

.card__img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.card__body { padding: 1rem 1.2rem 1.2rem; }

.card__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card__meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.card__score {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--warning);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--gap);
}


/* =============================================
   9. LISTAS
   ============================================= */
.list__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.list__item:first-child { border-top: 1px solid var(--border); }

.list__item:last-child { border-bottom: none; }


/* =============================================
   10. TABLAS
   ============================================= */
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

thead th {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

tbody tr:last-child td  { border-bottom: none; }
tbody tr:hover          { background: rgba(255, 255, 255, 0.02); }


/* =============================================
   11. UTILIDADES
   ============================================= */

/* Texto */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-left    { text-align: left; }

.text-muted   { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger  { color: var(--danger) !important; }
.text-white   { color: var(--text) !important; }

.font-bold    { font-weight: 700; }
.font-semibold{ font-weight: 600; }
.font-medium  { font-weight: 500; }
.font-normal  { font-weight: 400; }

.text-xs  { font-size: 0.75rem; }
.text-sm  { font-size: 0.875rem; }
.text-base{ font-size: 1rem; }
.text-lg  { font-size: 1.125rem; }
.text-xl  { font-size: 1.25rem; }

/* Espaciado */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Flex */
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.flex-wrap       { flex-wrap: wrap; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.ml-auto { margin-left: auto; }

/* Display */
.hidden       { display: none; }
.block        { display: block; }
.inline-flex  { display: inline-flex; }
.w-full       { width: 100%; }

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.badge--primary { background: rgba(79, 70, 229, 0.15); color: var(--primary); }
.badge--success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge--warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge--muted   { background: rgba(148, 163, 184, 0.12); color: var(--text-muted); }


/* =============================================
   12. AVATAR STACK
   ============================================= */
.avatar-stack {
    display: flex;
    align-items: center;
}

.avatar-stack .av {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--bg);
    background: var(--surface-2);
    overflow: hidden;
    margin-right: -8px;
    object-fit: cover;
    font-size: 0.65rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-stack .av:last-child { margin-right: 0; }


/* =============================================
   13. FEATURES GRID
   ============================================= */
.features-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.feature-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1.25rem;
    transition: border-color var(--transition), transform var(--transition);
}

.feature-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
}

.feature-icon {
    width: 44px;
    height: 44px;
    background: rgba(79, 70, 229, 0.12);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary);
}

.feature-icon svg { width: 22px; height: 22px; }

.feature-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.feature-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0;
}


/* =============================================
   14. STATS STRIP
   ============================================= */
.stats-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

.stat-item__icon {
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center;
}

.stat-item__icon svg { width: 28px; height: 28px; }

.stat-item__number {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.stat-item__label {
    font-size: 0.875rem;
    color: var(--text-muted);
}


/* =============================================
   15. SITE FOOTER
   ============================================= */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding-block: 3.5rem 2rem;
    margin-top: 4rem;
}

.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 2fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.footer__brand-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    max-width: 200px;
    line-height: 1.55;
}

.footer__socials {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.footer__socials a {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: background var(--transition), color var(--transition);
}

.footer__socials a:hover {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary);
}

.footer__socials svg { width: 15px; height: 15px; }

.footer__col h5 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin-bottom: 1rem;
}

.footer__col ul {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.footer__col ul a {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer__col ul a:hover { color: var(--text); }

.footer__newsletter-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
    line-height: 1.5;
}

.footer__newsletter-form {
    display: flex;
    gap: 0.5rem;
}

.footer__newsletter-form input { flex: 1; }

.footer__bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}


/* =============================================
   16. LANG TOGGLE
   ============================================= */
.lang-toggle {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.lang-toggle a {
    padding: 0.3rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: background var(--transition), color var(--transition);
    line-height: 1;
}

.lang-toggle a:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }

.lang-toggle a.active {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

.lang-toggle a + a {
    border-left: 1px solid var(--border);
}


/* =============================================
   17. MEDIA QUERIES
   ============================================= */

/* Tablet ≤ 1024px */
@media (max-width: 1024px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }

    .topbar__nav { display: none; }

    .card-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

/* Mobile ≤ 768px */
@media (max-width: 768px) {
    :root {
        --container-pad: 1rem;
        --gap: 1rem;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }

    .topbar__inner { height: 56px; gap: 1rem; }

    .auth-box { padding: 1.75rem; }

    .card-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

    .field-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .section__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Mobile small ≤ 480px */
@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }

    .auth-box {
        padding: 1.25rem;
        border-radius: var(--radius);
    }

    .auth-wrap { align-items: flex-start; padding-top: 1.5rem; }

    .card-grid { grid-template-columns: 1fr; }

    .btn--full-mobile { width: 100%; }

    table          { font-size: 0.8rem; }
    thead th,
    tbody td       { padding: 0.6rem 0.75rem; }
}
