/* Variables de color y espaciado reutilizables en todo el sitio */
:root {
    --color-primary: #2563eb;
    --color-success: #16a34a;
    --color-error: #dc2626;
    --color-warning: #d97706;
    --color-bg: #f8fafc;
    --color-card-bg: #ffffff;
    --color-border: #e2e8f0;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --radius: 8px;
    --spacing: 1rem;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    margin: 0;
    line-height: 1.6;
}

.site-header {
     background: #ffffff;
    padding: 0 2rem;
    height: 56px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .logo {
   font-weight: 700;
    font-size: 1.1rem;
    color: #1e3a5f;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.site-header .logo:hover {
    color: #2563eb;
    text-decoration: none;
}

.site-header nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.site-header nav a {
   margin-left: 0;
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.site-header nav a:hover {
   color: #1e3a5f;
    background: #f1f5f9;
    text-decoration: none;
}

/* Botón "Cerrar sesión" en el nav */
.site-header nav a.btn-nav-outline {
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
}

.site-header nav a.btn-nav-outline:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #334155;
}

.site-content {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.site-footer {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* ── Tarjetas (cards) ───────────────────────────────────── */
.card {
   background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.card h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
}

.card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 0.75rem;
}

/* Encabezado de la página de dashboard */
.dashboard-header {
    margin-bottom: 1.75rem;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.2rem;
}

.dashboard-header p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

/* ── Formularios ────────────────────────────────────────── */
.form-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 420px;
}

.form-card label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
}

.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="password"] {
    padding: 0.6rem 0.85rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    background: #fafafa;
    color: #0f172a;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-card input:focus {
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Input de archivo personalizado */
.file-upload-wrapper {
    position: relative;
}


.file-upload-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1.5px dashed #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    background: #f8fafc;
    transition: border-color 0.15s, background 0.15s;
    font-size: 0.875rem;
    color: #64748b;
}

.file-upload-label:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

.file-upload-label .upload-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.file-upload-label .upload-text strong {
    display: block;
    color: #1e293b;
    font-size: 0.875rem;
}

.file-upload-label .upload-text span {
    font-size: 0.78rem;
}

/* Ocultamos el input real, mostramos el label estilizado */
.file-upload-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.form-card small {
    font-size: 0.78rem;
    color: #94a3b8;
}

/* ── Botones ────────────────────────────────────────────── */
.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
}

/* ── Alertas ────────────────────────────────────────────── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin: 0.5rem 0;
}

.alert-error {
    background: #fef2f2;
    color: var(--color-error);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: var(--color-success);
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fffbeb;
    color: var(--color-warning);
    border: 1px solid #fde68a;
}

/* ── Barra de almacenamiento ────────────────────────────── */
.storage-wrap {
    margin-bottom: 0.75rem;
}

.storage-bar {
    background: #f1f5f9;
    border-radius: 999px;
    height: 8px;
    width: 100%;
    overflow: hidden;
    margin-bottom: 0.6rem;
}

.storage-bar-fill {
   height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    transition: width 0.4s ease;
}

.storage-bar-fill.is-warning {
    background: linear-gradient(90deg, #dc2626, #f87171);
}

.storage-stats strong {
    color: #1e293b;
}

.storage-detail {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 0.35rem;
}

/* ── Tabla de credenciales ──────────────────────────────── */
.credentials-table {
    border-collapse: collapse;
    width: 100%;
}

.credentials-table td {
    padding: 0.5rem 1rem 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

.credentials-table td:first-child {
    font-weight: 500;
    width: 150px;
}

/* ── Bloques de código ──────────────────────────────────── */
.code-block {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    font-size: 0.875rem;
}

.text-muted {
    color: var(--color-text-muted);
}

/* ── Layout full-width para la landing page ──────────────── */
.site-content--full {
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: white;
    padding: 5rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 680px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    margin-bottom: 1.25rem;
}

.hero-title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
    color: white;
    margin: 0 0 1.25rem;
}

.hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.85);
    margin: 0 0 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-hero-primary {
    background: white;
    color: #1e3a5f;
    padding: 0.85rem 1.75rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-hero-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    text-decoration: none;
}

.btn-hero-secondary {
    background: transparent;
    color: rgba(255,255,255,0.9);
    padding: 0.85rem 1.75rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    border: 1px solid rgba(255,255,255,0.4);
    transition: background 0.15s;
}

.btn-hero-secondary:hover {
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

/* ── Botones del header ───────────────────────────────────── */
.btn-nav-primary {
    background: white;
    color: #1e3a5f;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: opacity 0.15s;
}

.btn-nav-primary:hover {
    opacity: 0.9;
    text-decoration: none;
}

.btn-nav-outline {
    border: 1px solid rgba(255,255,255,0.4);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    color: rgba(255,255,255,0.85);
    font-size: 0.875rem;
    text-decoration: none;
}

.btn-nav-outline:hover {
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

/* ── Features ────────────────────────────────────────────── */
.features {
    background: #f8fafc;
    padding: 4rem 2rem;
}

.features-inner {
    max-width: 960px;
    margin: 0 auto;
}

.features-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 2.5rem;
    color: #1e3a5f;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(15,23,42,0.06);
}

.feature-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.feature-card h3 {
    font-size: 1rem;
    color: #1e3a5f;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* ── Casos de uso ────────────────────────────────────────── */
.usecases {
    background: white;
    padding: 4rem 2rem;
}

.usecases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.usecase {
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.usecase-emoji {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.usecase h4 {
    font-size: 0.95rem;
    color: #1e3a5f;
    margin: 0 0 0.4rem;
    font-weight: 600;
}

.usecase p {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* ── CTA final ───────────────────────────────────────────── */
.cta {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    padding: 4rem 2rem;
    text-align: center;
    color: white;
}

.cta-inner {
    max-width: 560px;
    margin: 0 auto;
}

.cta h2 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.cta p {
    color: rgba(255,255,255,0.8);
    margin-bottom: 1.75rem;
    font-size: 0.95rem;
}

/* ── Layout de autenticación ──────────────────────────────── */
.auth-body {
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.auth-logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e3a5f;
    text-decoration: none;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.auth-logo:hover {
    text-decoration: none;
    color: #2563eb;
}

.auth-card {
    width: 100%;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08),
                0 1px 4px rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.auth-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.25rem;
    text-align: center;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    text-align: center;
    margin: 0 0 1.5rem;
}

/* ── Formulario de auth ───────────────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
}

.form-group input {
    padding: 0.65rem 0.85rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    background: #fafafa;
    color: #0f172a;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-group input:focus {
    border-color: #2563eb;
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group input::placeholder {
    color: #cbd5e1;
}

/* Fila que tiene el label izquierda y link derecha */
.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-label-link {
    font-size: 0.78rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.form-label-link:hover {
    text-decoration: underline;
}

/* Botón principal del formulario de auth */
.btn-auth {
    width: 100%;
    padding: 0.75rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.925rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    margin-top: 0.25rem;
}

.btn-auth:hover {
    background: #1d4ed8;
}

.btn-auth:active {
    transform: scale(0.98);
}

/* Texto de switch (¿No tienes cuenta?) */
.auth-switch {
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
    margin: 1rem 0 0;
}

.auth-switch a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
}

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

/* Texto de footer debajo de la card */
.auth-footer-text {
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    margin: 0;
}

.auth-footer-text a {
    color: #94a3b8;
    text-decoration: none;
}

.auth-footer-text a:hover {
    color: #64748b;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-card {
        padding: 1.5rem;
        border-radius: 12px;
    }

    .auth-body {
        align-items: flex-start;
        padding-top: 2rem;
    }
}

/* ── Responsive Dashboard ────────────────────────────────── */
@media (max-width: 640px) {
    .site-header {
        padding: 0 1rem;
    }

    .site-header nav a {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
    }

    .site-content {
        margin: 1.25rem auto;
        padding: 0 1rem;
    }

    .card {
        padding: 1.25rem;
        border-radius: 10px;
    }

    .dashboard-header h1 {
        font-size: 1.25rem;
    }

    .form-card {
        max-width: 100%;
    }

    .storage-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* ── Guía de subida de ZIP ───────────────────────────────── */
.upload-guide {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.upload-guide summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    transition: background 0.15s;
    user-select: none;
}

/* Quitamos el triángulo nativo en webkit */
.upload-guide summary::-webkit-details-marker { display: none; }

.upload-guide summary:hover {
    background: #f1f5f9;
}

.upload-guide[open] summary {
    border-bottom: 1px solid #e2e8f0;
    background: #f1f5f9;
}

.guide-badge {
    font-size: 0.72rem;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-weight: 600;
}

.upload-guide[open] .guide-badge {
    background: #e0e7ff;
    color: #4338ca;
}

.guide-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Cada paso numerado */
.guide-step {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
}

.guide-step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.guide-step strong {
    display: block;
    font-size: 0.875rem;
    color: #1e293b;
    margin-bottom: 0.3rem;
}

.guide-step p {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0 0 0.5rem;
    line-height: 1.5;
}

.guide-step .code-block {
    font-size: 0.75rem;
    padding: 0.65rem 0.85rem;
    margin: 0;
}

.guide-list {
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0;
}

.guide-list li {
    font-size: 0.82rem;
    color: #64748b;
}

/* Nota de advertencia al final */
.guide-note {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    color: #92400e;
    line-height: 1.5;
}