/* Blog Styles - Coherente con la Landing */

/* Importar variables de la landing */
:root{
  --bg: #faf7f2;          /* marfil papel */
  --surface: #f3efe7;     /* arena clara */
  --surface-2: #e9e4da;   /* lino */
  --text: #1d1c1a;        /* carbón suave */
  --muted: #6d6a64;       /* topo cálido */

  --brand: #2f5d50;       /* verde salvia profundo */
  --brand-2: #5f8a7a;     /* salvia media */
  --accent: #b08968;      /* bronce/tostado */
  --accent-2: #d2b48c;    /* madera clara */

  --ok: #2f5d50;
  --warn: #d7a215;
  --err: #b34b4b;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 10px 30px rgba(24,22,18,.06);
  --shadow-2: 0 22px 60px rgba(24,22,18,.14);
  --blur: saturate(140%) blur(10px);
  --maxw: 1200px;
  --transition-fast: 180ms cubic-bezier(.2,.8,.2,1);
  --transition: 320ms cubic-bezier(.22,.61,.36,1);
  --transition-slow: 560ms cubic-bezier(.22,.61,.36,1);
}

@media (prefers-color-scheme: dark) {
  :root{
    --bg: #0e1110;          /* bosque profundo */
    --surface: #121613;
    --surface-2: #161b17;
    --text: #f3f1ec;
    --muted: #b7b4ad;
    --brand: #74b49b;       /* salvia iluminada */
    --brand-2: #97c7b4;
    --accent: #c79d78;
    --accent-2: #a9865f;
    --shadow-1: 0 10px 30px rgba(0,0,0,.35);
    --shadow-2: 0 20px 60px rgba(0,0,0,.6);
  }
}

/* Reset básico */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
}

/* Blog Header */
.blog-header {
  text-align: center;
  margin: 3rem 0;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  backdrop-filter: var(--blur);
  border: 1px solid color-mix(in srgb, var(--brand) 15%, transparent);
}

.blog-header h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.blog-header p {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0;
  max-width: 600px;
  margin: 0 auto;
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

.blog-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: all var(--transition);
  border: 1px solid color-mix(in srgb, var(--brand) 10%, transparent);
  position: relative;
}

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, color-mix(in srgb, var(--brand) 3%, transparent) 100%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
  border-radius: var(--radius);
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-2);
  border-color: color-mix(in srgb, var(--brand) 20%, transparent);
}

.blog-card:hover::before {
  opacity: 1;
}

.blog-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.blog-card:hover img {
  transform: scale(1.05);
}

.blog-card-content {
  padding: 2rem;
  position: relative;
  z-index: 2;
}

.blog-card .date {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.blog-card h3 {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.blog-card p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* Botones modernos */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(47, 93, 80, 0.3);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(47, 93, 80, 0.4);
  background: linear-gradient(135deg, var(--brand-2) 0%, var(--brand) 100%);
}

.btn.btn-green {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
  font-size: 1.05rem;
  padding: 1rem 2rem;
}

.btn.btn-green:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.4);
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--text) 20%, transparent);
}

.btn.secondary:hover {
  background: var(--accent-2);
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

/* Estados vacíos */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 2px dashed color-mix(in srgb, var(--muted) 30%, transparent);
  margin: 3rem 0;
}

.empty-state h3 {
  color: var(--text);
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

.empty-state p {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 2rem;
}

/* Modal de autenticación */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: color-mix(in srgb, var(--text) 60%, transparent);
  backdrop-filter: var(--blur);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn var(--transition) ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-modal {
  background: var(--bg);
  border-radius: var(--radius);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2);
  border: 1px solid color-mix(in srgb, var(--brand) 15%, transparent);
  animation: slideUp var(--transition) ease-out;
  margin-bottom: 5rem;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.auth-modal-content {
  padding: 2.5rem;
}

.auth-modal h2 {
  color: var(--brand);
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.auth-modal h4 {
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

/* Stepper */
.stepper {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
  gap: 1rem;
}

.stepper .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 30%, transparent);
  transition: all var(--transition);
  position: relative;
}

.stepper .dot.active {
  background: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 20%, transparent);
}

/* Formularios */
.form-step {
  display: none;
  animation: slideInForm var(--transition) ease-out;
}

.form-step.active {
  display: block;
}

@keyframes slideInForm {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--text) 20%, transparent);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  transition: all var(--transition);
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
  background: var(--bg);
}

.phone-grid {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.75rem;
}

.form-actions {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-actions .btn {
  justify-content: center;
}

.form-actions a {
  color: var(--muted);
  text-decoration: none;
  text-align: center;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-size: 0.9rem;
}

.form-actions a:hover {
  background: color-mix(in srgb, var(--muted) 10%, transparent);
  color: var(--text);
}

.validation-message {
  color: var(--err);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: color-mix(in srgb, var(--err) 10%, transparent);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--err);
}

/* Contenido bloqueado */
.content-blocked {
  filter: blur(8px) grayscale(50%);
  pointer-events: none;
  user-select: none;
  transition: filter var(--transition-slow);
}

/* User Info */
.user-info {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--muted);
  box-shadow: var(--shadow-1);
  z-index: 100;
  border: 1px solid color-mix(in srgb, var(--brand) 15%, transparent);
  backdrop-filter: var(--blur);
}

.user-info a {
  color: var(--brand);
  text-decoration: none;
  margin-left: 0.5rem;
  font-weight: 600;
  transition: color var(--transition);
}

.user-info a:hover {
  color: var(--brand-2);
}

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand);
  text-decoration: none;
  margin-bottom: 2rem;
  font-weight: 600;
  transition: all var(--transition);
  padding: 0.5rem 0;
}

.back-link:hover {
  color: var(--brand-2);
  transform: translateX(-4px);
}

/* Responsive */
@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .blog-header {
    margin: 2rem 0;
    padding: 2rem 1.5rem;
  }

  .blog-card-content {
    padding: 1.5rem;
  }

  .auth-modal-content {
    padding: 2rem;
  }

  .user-info {
    position: static;
    margin-bottom: 1rem;
    text-align: center;
  }

  .form-actions {
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }

  .blog-header {
    padding: 1.5rem 1rem;
  }

  .blog-card-content {
    padding: 1.25rem;
  }

  .auth-modal-content {
    padding: 1.5rem;
  }

  .phone-grid {
    grid-template-columns: 100px 1fr;
    gap: 0.5rem;
  }
}