/* ============================================================
   ETTERNIO - Estilos principales
   Paleta: negro profundo, dorado cálido, crema suave
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Jost:wght@300;400;500&display=swap');

:root {
  --black:       #0a0a0a;
  --deep:        #111111;
  --card:        #181818;
  --border:      #2a2a2a;
  --gold:        #c9a84c;
  --gold-light:  #e2c97e;
  --gold-dim:    #7a6030;
  --cream:       #f5f0e8;
  --text:        #d4cfc5;
  --muted:       #7a7570;
  --danger:      #c0392b;
  --success:     #27ae60;
  --radius:      12px;
  --shadow:      0 4px 24px rgba(0,0,0,0.5);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Jost', sans-serif;
  background: var(--black);
  color: var(--text);
  min-height: 100vh;
  font-weight: 300;
  line-height: 1.6;
}

a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-light); }

h1,h2,h3,h4 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  letter-spacing: .02em;
}

/* ---- HEADER ---- */
.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  background: var(--deep);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-circle {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #1a1a1a, #000);
  border: 2px solid var(--gold-dim);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(201,168,76,.25);
}

.logo-circle::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe066 0%, #c9a84c 50%, transparent 70%);
  box-shadow: 0 0 12px 4px rgba(255,224,102,.4);
  animation: pulse-gold 3s ease-in-out infinite;
}

@keyframes pulse-gold {
  0%,100% { transform: scale(1); opacity: .9; }
  50%      { transform: scale(1.15); opacity: 1; }
}

.brand-text { line-height: 1.1; }
.brand-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  color: var(--gold);
  letter-spacing: .06em;
}
.brand-slogan {
  font-size: .68rem;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
}

.header-right { margin-left: auto; display: flex; align-items: center; gap: 1rem; }

/* ---- LANDING ---- */
.landing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 70px);
}

.hero-col {
  position: relative;
  overflow: hidden;
  min-height: 400px;
}

.hero-bg {
  position: absolute; inset: 0;
  background-image: url('../img/fondo-web.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  overflow: hidden;
}

.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.08) 0%, rgba(0,0,0,.60) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative; z-index: 1;
  padding: 3rem 2.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.hero-content h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.4rem;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 1rem;
  font-weight: 300;
  font-style: italic;
}

.hero-content p {
  color: rgba(255,255,255,.8);
  font-size: .95rem;
  max-width: 420px;
  line-height: 1.7;
}

/* ---- AUTH PANEL ---- */
.auth-col {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 2rem;
  background: var(--deep);
}

.auth-box {
  width: 100%; max-width: 380px;
}

.auth-box h2 {
  font-size: 2rem;
  color: var(--cream);
  margin-bottom: .25rem;
}

.auth-box p.sub {
  color: var(--muted);
  font-size: .85rem;
  margin-bottom: 2rem;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ---- FORMS ---- */
.form-group {
  margin-bottom: 1.2rem;
}

label {
  display: block;
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .4rem;
}

input[type=text], input[type=email], input[type=password],
input[type=date], select, textarea {
  width: 100%;
  padding: .75rem 1rem;
  background: #1c1c1c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: 'Jost', sans-serif;
  font-size: .9rem;
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold-dim);
  box-shadow: 0 0 0 3px rgba(201,168,76,.12);
}

select option { background: #1c1c1c; }

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

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: .5rem;
  padding: .75rem 1.6rem;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .04em;
  transition: all .2s;
  text-decoration: none;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold), #a8893a);
  color: #0a0a0a;
}
.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #000;
  box-shadow: 0 4px 16px rgba(201,168,76,.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  padding: .5rem .8rem;
}
.btn-ghost:hover { color: var(--gold); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm { padding: .45rem 1rem; font-size: .8rem; }
.btn-block { width: 100%; }

/* ---- ALERTS ---- */
.alert {
  padding: .9rem 1.2rem;
  border-radius: var(--radius);
  font-size: .88rem;
  margin-bottom: 1rem;
  border-left: 3px solid;
}
.alert-error   { background: rgba(192,57,43,.15); border-color: var(--danger); color: #e74c3c; }
.alert-success { background: rgba(39,174,96,.15);  border-color: var(--success); color: #2ecc71; }
.alert-info    { background: rgba(201,168,76,.12); border-color: var(--gold-dim); color: var(--gold-light); }

/* ---- PRIVATE AREA ---- */
.app-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 0;
  min-height: calc(100vh - 70px);
}

.main-feed { padding: 2rem; }
.right-sidebar {
  background: var(--deep);
  border-left: 1px solid var(--border);
  padding: 1.5rem;
  min-height: 100%;
}

/* Cover */
.cover-wrapper {
  position: relative;
  height: 220px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, #1a1a1a, #0d0d0d);
  border: 1px solid var(--border);
}
.cover-wrapper img { width: 100%; height: 100%; object-fit: cover; }
.cover-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 60%);
  display: flex; align-items: flex-end; padding: 1.2rem;
  gap: .8rem;
}
.cover-edit-btn {
  background: rgba(0,0,0,.6);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  padding: .4rem .9rem;
  border-radius: 8px;
  font-size: .78rem;
  cursor: pointer;
  transition: all .2s;
}
.cover-edit-btn:hover { background: rgba(201,168,76,.4); }

/* Post box */
.post-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}

.post-box h3 {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1rem;
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .75rem;
}

.post-type-tabs {
  display: flex; gap: .5rem; margin-bottom: 1rem;
}

.tab-btn {
  padding: .4rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
  font-family: 'Jost', sans-serif;
}
.tab-btn.active, .tab-btn:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
  background: rgba(201,168,76,.08);
}

/* Publication cards */
.pub-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
  transition: border-color .2s;
}
.pub-card:hover { border-color: var(--gold-dim); }
.pub-card-body { padding: 1.2rem; }
.pub-card-meta {
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: .6rem;
}
.pub-card-text { font-size: .92rem; line-height: 1.7; }
.pub-card-media { width: 100%; max-height: 400px; object-fit: cover; }
.pub-card-footer {
  display: flex;
  gap: 1rem;
  padding: .8rem 1.2rem;
  border-top: 1px solid var(--border);
  align-items: center;
}

/* Reaction buttons */
.react-btn {
  display: flex; align-items: center; gap: .4rem;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: .82rem;
  font-family: 'Jost', sans-serif;
  padding: .3rem .6rem;
  border-radius: 8px;
  transition: all .2s;
}
.react-btn:hover { color: var(--gold); background: rgba(201,168,76,.08); }
.react-btn.liked { color: #e74c3c; }
.react-btn svg { width: 16px; height: 16px; }

/* Familiar circles */
.familiar-list { display: flex; flex-direction: column; gap: .8rem; }

.familiar-item {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #141414;
  text-decoration: none;
  transition: all .2s;
}
.familiar-item:hover {
  border-color: var(--gold-dim);
  background: rgba(201,168,76,.05);
}

.familiar-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--border);
  object-fit: cover;
  border: 2px solid var(--gold-dim);
  flex-shrink: 0;
}

.familiar-avatar-placeholder {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
  border: 2px solid var(--gold-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.familiar-info { flex: 1; min-width: 0; }
.familiar-name { font-size: .88rem; color: var(--cream); font-weight: 400; }
.familiar-dates { font-size: .72rem; color: var(--muted); }

/* Plan widget */
.plan-widget {
  background: linear-gradient(135deg, #1a1510, #0d0d0d);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
}
.plan-widget h4 { font-family:'Cormorant Garamond',serif; color: var(--gold); margin-bottom: .5rem; }
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin: .6rem 0 .4rem;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  border-radius: 3px;
  transition: width .5s ease;
}

/* Chat */
.chat-box { display: flex; flex-direction: column; gap: .5rem; }
.chat-messages {
  background: #141414;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem;
  height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.chat-msg { font-size: .8rem; }
.chat-msg strong { color: var(--gold-light); }
.chat-input-row { display: flex; gap: .5rem; }
.chat-input-row input { flex: 1; }

/* Familiar profile page */
.familiar-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: linear-gradient(135deg, #1a1a1a, #0d0d0d);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.familiar-profile-img {
  width: 100px; height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
}

.familiar-profile-placeholder {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  border: 3px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}

.familiar-header-info h2 {
  font-size: 2rem; color: var(--cream);
}
.familiar-epitafio {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--muted);
  margin-top: .3rem;
  font-size: 1.05rem;
}

/* Vela modal */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.8);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--card);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  padding: 2rem;
  width: min(400px, 90vw);
  position: relative;
}
.modal-box h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  color: var(--cream);
  margin-bottom: 1rem;
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none;
  color: var(--muted); font-size: 1.4rem;
  cursor: pointer;
}

.vela-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .7rem;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  color: var(--text);
}
.vela-option:hover { border-color: var(--gold-dim); background: rgba(201,168,76,.06); color: var(--gold); }
.vela-icon { font-size: 1.4rem; margin-right: .6rem; }
.vela-price { color: var(--gold); font-weight: 500; }

/* Admin */
.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: var(--deep);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
}
.admin-sidebar nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem 1rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: .3rem;
  transition: all .2s;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
  background: rgba(201,168,76,.1);
  color: var(--gold);
}
.admin-content { padding: 2rem; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.stat-card .stat-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.4rem;
  color: var(--gold);
  line-height: 1;
  margin-bottom: .3rem;
}
.stat-card .stat-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.data-table th {
  padding: .7rem 1rem;
  background: #1a1a1a;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  text-align: left;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .72rem;
}
.data-table td {
  padding: .75rem 1rem;
  border-bottom: 1px solid #1e1e1e;
  color: var(--text);
}
.data-table tr:hover td { background: rgba(255,255,255,.02); }

.badge {
  padding: .25rem .6rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 500;
}
.badge-green  { background: rgba(39,174,96,.2); color: #2ecc71; }
.badge-red    { background: rgba(192,57,43,.2); color: #e74c3c; }
.badge-yellow { background: rgba(201,168,76,.2); color: var(--gold); }

/* Section headings */
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  color: var(--cream);
  margin-bottom: 1.5rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

/* Pasarelas de pago */
.gateway-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.gateway-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  cursor: pointer;
  text-align: center;
  transition: all .25s;
  text-decoration: none;
  color: var(--text);
}
.gateway-card:hover, .gateway-card.selected {
  border-color: var(--gold);
  background: rgba(201,168,76,.06);
}
.gateway-card .gw-logo {
  font-size: 2.5rem;
  margin-bottom: .8rem;
}
.gateway-card h3 { font-family:'Cormorant Garamond',serif; font-size:1.4rem; color:var(--cream); }

/* Responsive */
@media (max-width: 768px) {
  .landing-grid { grid-template-columns: 1fr; }
  .hero-col { min-height: 260px; }
  .app-layout { grid-template-columns: 1fr; }
  .right-sidebar { border-left: none; border-top: 1px solid var(--border); }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { border-right: none; border-bottom: 1px solid var(--border); }
  .gateway-cards { grid-template-columns: 1fr; }
  .site-header { padding: .8rem 1rem; }
}
