/* ============================================================
   RENACE · Hoja de estilos global
   Paleta: verde salvia · crema · tierra · calma
   ============================================================ */

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

/* ── Variables ─────────────────────────────────────────── */
:root {
  --sage-50:  #F4F8F3;
  --sage-100: #E2EEE0;
  --sage-200: #C5DCC2;
  --sage-300: #9DC299;
  --sage-400: #6D9E6B;
  --sage-500: #4A7A48;
  --sage-600: #3A6038;
  --sage-700: #2E4D2C;

  --cream-50:  #FDFAF4;
  --cream-100: #F8F3E6;
  --cream-200: #F0E8D0;

  --earth-300: #C4A882;
  --earth-400: #B08E62;
  --earth-500: #8A6F48;

  --warm-red:  #C0392B;
  --warm-gold: #E8A838;
  --sky:       #6B9EB8;

  --text-dark:   #1E2D1C;
  --text-body:   #3A4A38;
  --text-muted:  #7A9678;
  --text-light:  #A8BCA6;

  --border:  #D4E6D0;
  --shadow:  0 4px 24px rgba(40,70,38,.08);
  --shadow-lg: 0 12px 48px rgba(40,70,38,.14);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  --transition: all .22s cubic-bezier(.4,0,.2,1);

  --sidebar-w: 260px;
  --topbar-h:  68px;
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-body);
  background: var(--cream-50);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--sage-500); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--sage-600); }

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

h1,h2,h3,h4,h5 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--text-dark);
  line-height: 1.25;
}
h1 { font-size: 2.4rem; font-weight: 300; }
h2 { font-size: 1.9rem; font-weight: 400; }
h3 { font-size: 1.4rem; font-weight: 400; }
h4 { font-size: 1.1rem; font-weight: 600; }

p { margin-bottom: .6rem; }

/* ── Auth pages ────────────────────────────────────────── */
.auth-body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--cream-50);
}

.auth-art {
  background: linear-gradient(160deg, var(--sage-600) 0%, var(--sage-400) 60%, var(--sage-300) 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 3rem;
  overflow: hidden;
}
.auth-art::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 30% 20%, rgba(255,255,255,.08) 0%, transparent 70%),
    radial-gradient(ellipse 60% 80% at 70% 80%, rgba(0,0,0,.12) 0%, transparent 70%);
}
.auth-art-circles {
  position: absolute; inset: 0; pointer-events: none;
}
.auth-art-circles span {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.12);
}
.auth-art-circles span:nth-child(1) { width:320px;height:320px;top:-80px;left:-80px; }
.auth-art-circles span:nth-child(2) { width:240px;height:240px;bottom:80px;right:-60px; }
.auth-art-circles span:nth-child(3) { width:180px;height:180px;top:40%;left:30%; }

.auth-art-text { position: relative; z-index: 1; }
.auth-art-text h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  font-weight: 300;
  color: #fff;
  margin-bottom: .8rem;
  line-height: 1.3;
}
.auth-art-text p { color: rgba(255,255,255,.75); font-size: .95rem; line-height: 1.7; }

.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
}
.auth-form-box {
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  margin-bottom: 2.5rem;
}
.auth-logo .brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 300;
  color: var(--sage-600);
  letter-spacing: .06em;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.auth-logo .tagline { color: var(--text-muted); font-size: .88rem; margin-top: .2rem; }

.auth-title { font-size: 1.6rem; font-weight: 400; margin-bottom: .4rem; }
.auth-subtitle { color: var(--text-muted); font-size: .9rem; margin-bottom: 2rem; }

/* ── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block;
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: .45rem;
}

.form-control {
  display: block;
  width: 100%;
  padding: .8rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  color: var(--text-dark);
  background: var(--cream-50);
  transition: var(--transition);
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--sage-400);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(109,158,107,.12);
}
.form-control::placeholder { color: var(--text-light); }

select.form-control {
  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 d='M1 1l5 5 5-5' stroke='%237A9678' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

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

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--sage-400), var(--sage-500));
  color: #fff;
  box-shadow: 0 2px 12px rgba(74,122,72,.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(74,122,72,.35);
  color: #fff;
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-body);
}
.btn-outline:hover { border-color: var(--sage-400); color: var(--sage-500); background: var(--sage-50); }
.btn-danger {
  background: #FEE;
  color: var(--warm-red);
  border: 1.5px solid #F5C6C0;
}
.btn-danger:hover { background: #FDD; }
.btn-sm { padding: .45rem .9rem; font-size: .82rem; }
.btn-lg { padding: .95rem 2rem; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }

/* ── App Layout ────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--sage-700) 0%, var(--sage-600) 100%);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0,0,0,.08);
}

.sidebar-logo {
  padding: 1.6rem 1.5rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-logo .brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem;
  font-weight: 300;
  color: #fff;
  letter-spacing: .06em;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.sidebar-logo .tagline { color: rgba(255,255,255,.5); font-size: .75rem; margin-top: .1rem; }

.sidebar-nav { flex: 1; padding: 1.2rem 0; overflow-y: auto; }

.nav-section {
  padding: .6rem 1.5rem .2rem;
  font-size: .68rem;
  font-weight: 500;
  color: rgba(255,255,255,.35);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .65rem 1.5rem;
  color: rgba(255,255,255,.65);
  font-size: .88rem;
  font-weight: 400;
  transition: var(--transition);
  border-left: 3px solid transparent;
  margin: .1rem 0;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); border-left-color: rgba(255,255,255,.3); }
.nav-item.active { color: #fff; background: rgba(255,255,255,.12); border-left-color: #fff; }
.nav-item .icon { width: 20px; text-align: center; font-size: 1rem; flex-shrink: 0; }
.nav-item .badge-count {
  margin-left: auto;
  background: var(--warm-gold);
  color: var(--text-dark);
  font-size: .7rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 20px;
}

.sidebar-user {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: .75rem;
}
.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  color: #fff;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { color: #fff; font-size: .85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { color: rgba(255,255,255,.45); font-size: .72rem; text-transform: capitalize; }
.sidebar-logout { color: rgba(255,255,255,.4); transition: var(--transition); }
.sidebar-logout:hover { color: rgba(255,255,255,.8); }

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 1rem;
}
.topbar-title { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; font-weight: 400; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.topbar-points {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: var(--sage-50);
  border: 1px solid var(--sage-200);
  border-radius: 20px;
  padding: .35rem .85rem;
  font-size: .85rem;
  color: var(--sage-600);
  font-weight: 500;
}

/* Page content */
.page-content {
  flex: 1;
  padding: 2rem;
}

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-body { padding: 1.5rem; }
.card-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card-header h3 { font-size: 1.1rem; font-weight: 600; font-family: 'DM Sans', sans-serif; color: var(--text-dark); }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); background: var(--sage-50); }

/* ── Stat cards ────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.6rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.green  { background: var(--sage-50);   }
.stat-icon.gold   { background: #FEF9EC; }
.stat-icon.sky    { background: #EFF6FC; }
.stat-icon.earth  { background: #FBF5EE; }
.stat-value { font-family: 'Cormorant Garamond',serif; font-size: 2rem; font-weight: 300; color: var(--text-dark); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Progress ──────────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--sage-100);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sage-400), var(--sage-300));
  border-radius: 4px;
  transition: width .6s ease;
}

/* ── Level badge ───────────────────────────────────────── */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .8rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 500;
  background: var(--sage-50);
  color: var(--sage-600);
  border: 1px solid var(--sage-200);
}

/* ── Tables ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead th {
  padding: .75rem 1rem;
  text-align: left;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: .07em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--sage-50);
}
tbody td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--sage-50);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--sage-50); }

/* ── Badges / chips ────────────────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .65rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 500;
}
.chip-green  { background: var(--sage-50);  color: var(--sage-600); border: 1px solid var(--sage-200); }
.chip-gold   { background: #FEF9EC; color: #A87828; border: 1px solid #F0D898; }
.chip-red    { background: #FEF0EE; color: #C0392B; border: 1px solid #F5C6C0; }
.chip-sky    { background: #EFF6FC; color: #2E7DB0; border: 1px solid #BAD9EE; }
.chip-gray   { background: #F5F5F5; color: #666; border: 1px solid #E0E0E0; }

/* ── Alert / Flash ─────────────────────────────────────── */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.2rem;
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.alert-success { background: #F0FAF0; border: 1px solid #A8D5A6; color: #3A6A38; }
.alert-error   { background: #FEF0EE; border: 1px solid #F5C6C0; color: #C0392B; }
.alert-info    { background: #EFF6FC; border: 1px solid #BAD9EE; color: #2E7DB0; }
.alert-warning { background: #FEF9EC; border: 1px solid #F0D898; color: #A87828; }

/* ── Grid helpers ──────────────────────────────────────── */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ── Mood selector ─────────────────────────────────────── */
.mood-selector { display: flex; gap: .6rem; }
.mood-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--cream-50);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.mood-btn:hover, .mood-btn.active { border-color: var(--sage-400); background: var(--sage-50); transform: scale(1.1); }

/* ── Course card ───────────────────────────────────────── */
.course-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.course-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.course-thumb {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--sage-100), var(--sage-200));
}
.course-body { padding: 1.1rem; flex: 1; }
.course-title { font-size: 1rem; font-weight: 500; color: var(--text-dark); margin-bottom: .4rem; }
.course-meta { font-size: .8rem; color: var(--text-muted); display: flex; gap: .8rem; }
.course-footer { padding: .8rem 1.1rem; border-top: 1px solid var(--border); background: var(--sage-50); }

/* ── Conference card ───────────────────────────────────── */
.conf-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.3rem;
  display: flex;
  gap: 1rem;
  transition: var(--transition);
}
.conf-card:hover { box-shadow: var(--shadow-lg); }
.conf-date {
  text-align: center;
  background: var(--sage-600);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: .6rem .8rem;
  min-width: 56px;
  flex-shrink: 0;
}
.conf-day { font-size: 1.5rem; font-weight: 300; font-family: 'Cormorant Garamond',serif; line-height: 1; }
.conf-month { font-size: .65rem; text-transform: uppercase; letter-spacing: .1em; }

/* ── Welcome banner ────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, var(--sage-600) 0%, var(--sage-500) 60%, var(--sage-400) 100%);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.welcome-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 80% at 80% 50%, rgba(255,255,255,.07) 0%, transparent 70%);
}
.welcome-banner h2 { color: #fff; font-weight: 300; font-size: 1.8rem; position: relative; }
.welcome-banner p  { color: rgba(255,255,255,.75); font-size: .9rem; margin-top: .3rem; position: relative; }

/* ── Divider ───────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.divider-text {
  text-align: center;
  position: relative;
  margin: 1.5rem 0;
}
.divider-text::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.divider-text span {
  background: var(--cream-50);
  padding: 0 1rem;
  position: relative;
  color: var(--text-muted);
  font-size: .82rem;
}

/* ── Tabs ──────────────────────────────────────────────── */
.tabs { display: flex; gap: .2rem; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; }
.tab {
  padding: .65rem 1.2rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  text-decoration: none;
}
.tab:hover { color: var(--sage-500); }
.tab.active { color: var(--sage-600); border-bottom-color: var(--sage-500); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  .auth-body { grid-template-columns: 1fr; }
  .auth-art  { display: none; }
  .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); }
  .main-content { margin-left: 0; }
}

/* ── Admin specific ────────────────────────────────────── */
.admin-topbar-badge {
  background: var(--earth-400);
  color: #fff;
  font-size: .7rem;
  padding: .2rem .6rem;
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: .05em;
}

/* Misc utils */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: .85rem; }
.mt-1 { margin-top: .4rem; }
.mt-2 { margin-top: .8rem; }
.mt-3 { margin-top: 1.2rem; }
.mt-4 { margin-top: 1.8rem; }
.mb-1 { margin-bottom: .4rem; }
.mb-2 { margin-bottom: .8rem; }
.mb-3 { margin-bottom: 1.2rem; }
.flex { display: flex; align-items: center; gap: .75rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: .4rem; }
.gap-2 { gap: .8rem; }
.w-full { width: 100%; }
