/* ============================================================
   ESTUDIO DE CURADURIA - Thinking Skills Program
   Tema visual: oscuro creativo (Figma/Notion-inspired)
   ============================================================ */

/* ----- Reset y variables ----- */
:root {
  /* Paleta */
  --bg-base: #0d0f14;
  --bg-elevated: #161922;
  --bg-elevated-2: #1f2330;
  --bg-input: #11141c;
  --border: #2a2f3d;
  --border-subtle: #1d212c;

  --text-primary: #e8eaf0;
  --text-secondary: #9ca3b5;
  --text-muted: #6b7188;

  --accent: #7c5cff;
  --accent-hover: #6d4dff;
  --accent-soft: rgba(124, 92, 255, 0.12);

  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;

  /* Tipografia */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;

  /* Spacing y radios */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

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

html, body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ----- Layout: header / shell ----- */
.estudio-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.estudio-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 15px;
}

.brand-logo {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent) 0%, #5e3fd9 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  box-shadow: 0 0 16px rgba(124, 92, 255, 0.4);
}

.brand-name { letter-spacing: -0.01em; }
.brand-suffix {
  font-size: 11px;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-left: 4px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
}

.avatar {
  width: 32px; height: 32px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
}

.estudio-main {
  flex: 1;
  padding: 32px 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ----- Tipografia comun ----- */
h1.page-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.page-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

h2 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }

/* ----- Cards ----- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

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

/* ----- Empty state (dashboard sin juegos) ----- */
.empty-state {
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 64px 32px;
  text-align: center;
}
.empty-state-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  background: var(--accent-soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ----- Botones ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px rgba(124, 92, 255, 0.3);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 6px 20px rgba(124, 92, 255, 0.4); }

.btn-secondary {
  background: var(--bg-elevated-2);
  color: var(--text-primary);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-elevated-2); }

.btn-block { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 15px; }

/* ----- Forms ----- */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-group input::placeholder { color: var(--text-muted); }

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ----- Alertas ----- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-error {
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.25);
}
.alert-success {
  background: rgba(74, 222, 128, 0.08);
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.25);
}
.alert-info {
  background: rgba(96, 165, 250, 0.08);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.25);
}

/* ----- Login screen ----- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(ellipse at top, rgba(124, 92, 255, 0.12), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(96, 165, 250, 0.08), transparent 50%),
    var(--bg-base);
}

.login-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}
.login-header .brand-logo {
  width: 48px; height: 48px;
  font-size: 18px;
  margin: 0 auto 16px;
}
.login-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.login-header p {
  color: var(--text-secondary);
  font-size: 13px;
}

.login-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ----- Spinner ----- */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----- Responsive ----- */
@media (max-width: 640px) {
  .estudio-main { padding: 24px 16px; }
  .estudio-header { padding: 12px 16px; }
  .login-card { padding: 28px 20px; }
  h1.page-title { font-size: 22px; }
  .empty-state { padding: 48px 24px; }
}
