/* ═══════════════════════════════════════════════════════════════
   DinamoCheck — Design System & Styles
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ──────────────────────────────────── */
:root {
  /* Colors — Dark theme */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(31, 41, 55, 0.9);
  --bg-input: rgba(31, 41, 55, 0.7);
  --bg-input-focus: rgba(55, 65, 81, 0.6);

  --border-subtle: rgba(75, 85, 99, 0.4);
  --border-focus: #6366f1;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  /* Accent */
  --accent: #6366f1;
  --accent-light: rgba(99, 102, 241, 0.15);
  --accent-hover: #818cf8;

  /* Classification colors */
  --color-muy-debil: #ef4444;
  --color-debil: #f97316;
  --color-normal: #22c55e;
  --color-fuerte: #3b82f6;
  --color-muy-fuerte: #8b5cf6;

  --color-muy-debil-bg: rgba(239, 68, 68, 0.12);
  --color-debil-bg: rgba(249, 115, 22, 0.12);
  --color-normal-bg: rgba(34, 197, 94, 0.12);
  --color-fuerte-bg: rgba(59, 130, 246, 0.12);
  --color-muy-fuerte-bg: rgba(139, 92, 246, 0.12);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Subtle background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

body>* {
  position: relative;
  z-index: 1;
}

/* ─── Layout ─────────────────────────────────────────────────── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.hidden {
  display: none !important;
}

/* ─── PWA Install Button ─────────────────────────────────────── */
#installContainer {
  margin-left: auto;
  /* Push to the right if in flex container */
}

@media (max-width: 640px) {
  .header__row {
    justify-content: center;
    gap: var(--space-3);
  }

  .header__brand {
    justify-content: center;
    width: 100%;
    margin-bottom: var(--space-2);
  }

  #installContainer {
    margin-left: 0;
    margin-top: var(--space-2);
    /* Ensure it doesn't get pushed off */
    order: 2;
  }

  .auth-section {
    width: 100%;
    justify-content: center;
    order: 3;
    margin-top: var(--space-2);
  }
}

/* ─── Header ─────────────────────────────────────────────────── */
.header {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: transform 0.3s ease, padding 0.3s ease;
}

.header--hidden {
  transform: translateY(-100%);
}

.header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header__icon {
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--accent-light);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}

.header__title {
  font-size: var(--font-size-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header__subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 2px;
}

/* ─── Auth Section ───────────────────────────────────────────── */
.auth-section {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.btn--google {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn--google:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-avatar {
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  object-fit: cover;
  flex-shrink: 0;
}

.user-name {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-primary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-status {
  margin-top: var(--space-2);
  text-align: right;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: 500;
  padding: 2px var(--space-3);
  border-radius: var(--radius-full);
}

.auth-badge--local {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.auth-badge--online {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* ─── Disclaimer ─────────────────────────────────────────────── */
.disclaimer {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4);
  margin: var(--space-6) 0;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.disclaimer__icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-md);
}

.card__title {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.card__title-icon {
  font-size: 1.3rem;
}

/* ─── Form ───────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.required {
  color: var(--color-muy-debil);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 500;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
  -moz-appearance: textfield;
}

.input--with-suffix {
  padding-right: 4.2rem !important;
}

.input-wrapper input::-webkit-inner-spin-button,
.input-wrapper input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.input-wrapper input:focus {
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-wrapper input.input--error {
  border-color: var(--color-muy-debil);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-suffix {
  position: absolute;
  right: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-weight: 500;
  pointer-events: none;
}

.form-hint {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.form-error {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--font-size-xs);
  color: var(--color-muy-debil);
  min-height: 1rem;
}

/* ─── Radio cards ────────────────────────────────────────────── */
.radio-group {
  display: flex;
  gap: var(--space-3);
}

.radio-card {
  flex: 1;
  cursor: pointer;
}

.radio-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-card__content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-align: center;
}

.radio-card__icon {
  font-size: 1.3rem;
}

.radio-card__label {
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.radio-card input:checked+.radio-card__content {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.radio-card:hover .radio-card__content {
  border-color: rgba(99, 102, 241, 0.5);
  background: var(--bg-input-focus);
}

.radio-card--sm .radio-card__content {
  padding: var(--space-2) var(--space-4);
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn__icon {
  font-size: 1.1rem;
}

.btn--primary {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: white;
  font-size: var(--font-size-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), 0 0 20px rgba(99, 102, 241, 0.2);
  margin-top: var(--space-4);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(99, 102, 241, 0.3);
}

.btn--primary:active {
  transform: translateY(0);
}

.btn--outline {
  background: transparent;
  border: 1.5px solid var(--border-subtle);
  color: var(--text-primary);
  padding: var(--space-3) var(--space-5);
}

.btn--outline:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  padding: var(--space-2) var(--space-3);
}

.btn--ghost:hover {
  color: var(--color-muy-debil);
  background: rgba(239, 68, 68, 0.1);
}

.btn--sm {
  font-size: var(--font-size-sm);
  padding: var(--space-1) var(--space-3);
}

/* ─── Result Section ─────────────────────────────────────────── */
.result-section {
  animation: slideUp 0.5s ease both;
}

.result-card {
  overflow: hidden;
}

.result__header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6);
  margin: calc(-1 * var(--space-8));
  margin-bottom: var(--space-6);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.result__icon {
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.result__category {
  font-size: var(--font-size-3xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: white;
}

.result__percentile {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.75);
  margin-top: 2px;
  font-weight: 500;
}

/* Result stats */
.result__summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.result__stat {
  background: var(--bg-input);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.result__stat-label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.result__stat-value {
  display: block;
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-top: 2px;
}

/* ─── Percentile Bar ─────────────────────────────────────────── */
.percentile-bar-container {
  margin-bottom: var(--space-6);
}

.percentile-bar__title {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  font-weight: 500;
}

.percentile-bar {
  position: relative;
  display: flex;
  height: 36px;
  border-radius: var(--radius-full);
  overflow: visible;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.percentile-bar__zone {
  position: relative;
  height: 100%;
  transition: opacity var(--transition-fast);
}

.percentile-bar__zone--muy-debil {
  width: 5%;
  background: var(--color-muy-debil);
  border-radius: var(--radius-full) 0 0 var(--radius-full);
  opacity: 0.7;
}

.percentile-bar__zone--debil {
  width: 20%;
  background: var(--color-debil);
  opacity: 0.7;
}

.percentile-bar__zone--normal {
  width: 50%;
  background: var(--color-normal);
  opacity: 0.7;
}

.percentile-bar__zone--fuerte {
  width: 20%;
  background: var(--color-fuerte);
  opacity: 0.7;
}

.percentile-bar__zone--muy-fuerte {
  width: 5%;
  background: var(--color-muy-fuerte);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  opacity: 0.7;
}

.percentile-bar__marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.15), var(--shadow-md);
  z-index: 10;
  transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.percentile-bar__marker-label {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.percentile-bar__labels {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) var(--space-2) 0;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── Interpretation ─────────────────────────────────────────── */
.result__interpretation {
  padding: var(--space-5);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent);
  margin-bottom: var(--space-6);
}

.result__interp-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.result__interp-text {
  font-size: var(--font-size-base);
  line-height: 1.6;
  color: var(--text-primary);
}

.result__ai {
  padding: var(--space-5);
  background: rgba(99, 102, 241, 0.05);
  border-radius: var(--radius-md);
  border: 1px dashed var(--accent);
  margin-bottom: var(--space-6);
  position: relative;
}

.result__ai::before {
  content: "✨";
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 1.5rem;
  animation: pulse 2s infinite;
}

/* ─── Reference table ────────────────────────────────────────── */
.result__reference {
  margin-bottom: var(--space-6);
}

.result__ref-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.ref-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.ref-table th,
.ref-table td {
  padding: var(--space-2) var(--space-3);
  text-align: center;
  border: 1px solid var(--border-subtle);
}

.ref-table th {
  background: var(--bg-input);
  font-weight: 700;
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ref-table td {
  font-weight: 500;
}

.ref-table td.ref-table__highlight {
  background: var(--accent-light);
  font-weight: 700;
  color: var(--accent-hover);
}

/* ─── Result Actions ─────────────────────────────────────────── */
.result__actions {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-6);
}

@media (max-width: 640px) {
  .result__actions {
    flex-direction: column;
  }

  .result__actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ─── History ────────────────────────────────────────────────── */
.history__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
}

.history__header .card__title {
  margin-bottom: 0;
}

.history__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.history__empty {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  padding: var(--space-6) 0;
}

.history__item {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

.history__item:hover {
  background: var(--bg-card-hover);
}

.history__badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  flex-shrink: 0;
}

.history__info {
  flex: 1;
  min-width: 0;
}

.history__search-container {
  position: relative;
  flex: 1;
  max-width: 300px;
  margin: 0 var(--space-4);
}

.history__search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  opacity: 0.5;
  pointer-events: none;
}

.history__search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-8);
  color: var(--text-main);
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
}

.history__search-input:focus {
  outline: none;
  border-color: var(--color-muy-fuerte);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.history__label {
  font-size: var(--font-size-sm);
  font-weight: 700;
}

.history__meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.history__value {
  font-size: var(--font-size-lg);
  font-weight: 800;
  flex-shrink: 0;
}

.history__delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.history__delete:hover {
  color: var(--color-muy-debil);
  background: rgba(239, 68, 68, 0.1);
}

/* ─── Footer ─────────────────────────────────────────────────── */
.footer {
  margin-top: var(--space-8);
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer__ref {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto var(--space-4);
}

.footer__disclaimer {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: var(--space-4);
}

.footer__brand {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.footer__socials {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
}

.footer__social-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
}

.footer__social-link:hover {
  color: var(--color-muy-fuerte);
  border-color: var(--color-muy-fuerte);
  background: rgba(139, 92, 246, 0.1);
  transform: translateY(-2px);
}

.social-icon {
  font-size: 1.1rem;
}

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes pulse {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    transform: translate(-50%, -50%) scale(1.15);
  }
}

.animate-slide-up {
  animation: slideUp 0.5s ease both;
}

.animate-fade-in {
  animation: fadeIn 0.3s ease both;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .container {
    padding: 0 var(--space-4);
  }

  .card {
    padding: var(--space-5);
  }

  .header__row {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-section {
    justify-content: center;
  }

  .auth-status {
    text-align: center;
  }

  .user-name {
    max-width: 100px;
  }

  .header__icon {
    width: 44px;
    height: 44px;
    font-size: 1.8rem;
  }

  .header__title {
    font-size: var(--font-size-xl);
  }

  .result__header {
    padding: var(--space-5);
    margin: calc(-1 * var(--space-5));
    margin-bottom: var(--space-5);
    flex-direction: column;
    text-align: center;
  }

  .result__category {
    font-size: var(--font-size-2xl);
  }

  .result__icon {
    width: 56px;
    height: 56px;
    font-size: 2rem;
  }

  .result__summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .history__item {
    flex-wrap: wrap;
  }

  .percentile-bar__marker-label {
    font-size: 10px;
  }
}

@media (min-width: 768px) {
  .result__summary {
    grid-template-columns: repeat(4, 1fr);
  }
}