/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== THEME VARIABLES ===== */
:root {
  --bg-primary: #fafaf9;
  --bg-card: #ffffff;
  --bg-secondary: #f5f5f4;
  --bg-hover: #e7e5e4;
  --text-primary: #1a1a2e;
  --text-secondary: #57534e;
  --text-muted: #a8a29e;
  --border: #e7e5e4;
  --border-light: #f0f0ee;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.1);
  --accent-bg: #eef2ff;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --error: #ef4444;
  --error-bg: #fef2f2;
  --warning: #f59e0b;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08), 0 8px 32px rgba(0,0,0,0.06);
  --dot-color: #e5e5e4;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: 300ms ease-out;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  --bg-primary: #0a0a10;
  --bg-card: #141420;
  --bg-secondary: #1a1a28;
  --bg-hover: #22222e;
  --text-primary: #e8e8ec;
  --text-secondary: #a0a0b0;
  --text-muted: #6b6b7b;
  --border: #1e1e30;
  --border-light: #1a1a28;
  --accent: #818cf8;
  --accent-hover: #6366f1;
  --accent-light: rgba(129, 140, 248, 0.1);
  --accent-bg: rgba(129, 140, 248, 0.1);
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.1);
  --error: #f87171;
  --error-bg: rgba(248, 113, 113, 0.1);
  --warning: #fbbf24;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2), 0 1px 4px rgba(0,0,0,0.2);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.2);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.3), 0 8px 32px rgba(0,0,0,0.3);
  --dot-color: #1e1e28;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
  background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow-x: hidden;
  transition: background-color 0.3s, color 0.3s;
}

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

/* ===== LAYOUT ===== */
.app-container {
  max-width: 440px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== HEADER ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 0 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-icon svg {
  display: block;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-enviar { color: var(--text-primary); }
.logo-archivos { color: var(--accent); }

/* ===== AUTH ===== */
.auth-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-theme {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}

.btn-theme:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-theme svg {
  transition: transform 0.3s ease;
}

.btn-theme:active svg {
  transform: rotate(180deg);
}

.btn-login {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-login:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: none;
  transition: all var(--transition);
}

.user-avatar:hover {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

/* ===== VIEWS ===== */
.view {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  animation: viewEnter 400ms ease-out;
}

.view-active {
  display: flex;
}

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

/* ===== VIEW 1: HOME ===== */
.tagline {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 32px;
}

/* ===== CAR SCENE ===== */
.car-scene {
  width: 100%;
  max-width: 280px;
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 100px;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-bottom: 24px;
}

.plan-badge-container {
  margin-bottom: 16px;
}

.plan-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--border);
  color: var(--text-secondary);
}

.plan-badge-plus {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
}

.features {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.feature-item {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.feature-separator {
  color: var(--text-muted);
}

/* Transfer counter */
.transfer-counter {
  text-align: center;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.transfer-counter strong {
  color: var(--accent);
  font-weight: 700;
}

/* ===== DEVICE COMBOS ===== */
.device-combos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.device-combo-item {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ===== LANGUAGE SELECTOR (footer) ===== */
.lang-selector-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 10px;
}

.lang-flag-btn {
  background: none;
  border: 1.5px solid transparent;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 10px;
  transition: all 0.2s ease;
  opacity: 0.45;
  font-family: var(--font-body);
}

.lang-flag-btn:hover {
  opacity: 0.75;
}

.lang-flag-btn.active {
  opacity: 1;
  border-color: var(--accent);
  background: var(--accent-light);
}

.lang-flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-flag-cat {
  width: 16px;
  height: 11px;
  border-radius: 2px;
  display: inline-block;
  background: repeating-linear-gradient(
    to bottom,
    #fcdd09 0px, #fcdd09 2px,
    #da121a 2px, #da121a 4px
  );
  flex-shrink: 0;
}

.lang-code {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.lang-flag-btn.active .lang-code {
  color: var(--accent);
}

.home-footer {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 16px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  padding: 12px 24px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:active {
  transform: scale(0.95);
  transition-duration: 80ms;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-large {
  padding: 16px 24px;
  font-size: 1.05rem;
  border-radius: 14px;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.2) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-primary:hover:not(:disabled)::after {
  opacity: 1;
}

.btn-primary:hover:not(:disabled) {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.96) translateY(0);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--border);
}

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

.btn-secondary:active {
  transform: scale(0.96) translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 10px 16px;
}

.btn-ghost:hover {
  color: var(--accent);
}

.btn-danger {
  color: var(--error);
}

.btn-danger:hover {
  color: #dc2626;
}

.btn-download {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  background-size: 200% 200%;
  animation: downloadGradient 3s ease infinite;
}

@keyframes downloadGradient {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn-download:hover {
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.45);
  transform: translateY(-2px);
}

.btn-download:active {
  transform: translateY(0) scale(0.96);
  transition-duration: 80ms;
}

.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 8px 14px;
  transition: all var(--transition);
  font-family: var(--font-body);
}

.btn-copy:hover {
  background: var(--accent);
  color: white;
}

.btn-plus-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  padding: 10px 20px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-plus-cta:hover {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  width: 100%;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.file-card {
  padding: 16px 20px;
  margin-bottom: 20px;
}

/* ===== FILE INFO ===== */
.file-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.file-icon-image { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.file-icon-pdf { background: rgba(239, 68, 68, 0.1); color: var(--error); }
.file-icon-video { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.file-icon-audio { background: rgba(236, 72, 153, 0.1); color: #ec4899; }
.file-icon-default { background: var(--accent-bg); color: var(--accent); }

.file-icon svg { stroke: currentColor; }

.file-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 4px;
}

.file-size,
.file-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ===== PROGRESS BAR ===== */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  border-radius: 4px;
  transition: width 200ms ease-out;
  position: relative;
}

.progress-bar.indeterminate {
  width: 100% !important;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%;
  animation: indeterminate 1.5s linear infinite;
}

@keyframes indeterminate {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.progress-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.upload-speed {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-family: var(--font-mono);
  min-height: 1.2em;
}

/* ===== QR VIEW ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
}

.qr-container {
  background: white;
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-container canvas,
.qr-container img {
  display: block;
  border-radius: 8px;
}

.code-display {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.code-text {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  background: var(--bg-secondary);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
}

.file-info-mini {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.help-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 16px;
}

/* ===== RECEIVE VIEW ===== */
.receive-icon {
  margin-bottom: 16px;
  opacity: 0.8;
}

.view-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.view-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  text-align: center;
}

.otp-inputs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.otp-input {
  width: 60px;
  height: 68px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: all var(--transition);
  text-transform: uppercase;
  caret-color: var(--accent);
}

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

.otp-input.error {
  border-color: var(--error);
  animation: shake 400ms ease-out;
}

.otp-input.filled {
  border-color: var(--accent);
  background: var(--accent-bg);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.otp-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-inline {
  font-size: 0.85rem;
  color: var(--error);
  font-weight: 500;
  margin-bottom: 12px;
  text-align: center;
}

.help-text-secondary {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-align: center;
}

/* ===== DOWNLOAD VIEW ===== */
.success-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success), #059669);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 0 0 16px rgba(16, 185, 129, 0); }
}

.check-icon {
  animation: checkDraw 500ms ease-out;
}

@keyframes checkDraw {
  from { stroke-dashoffset: 30; stroke-dasharray: 30; }
  to { stroke-dashoffset: 0; stroke-dasharray: 30; }
}

/* ===== SUCCESS ANIMATION (explosive check) ===== */
.success-animation {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
}

.success-animation svg {
  width: 80px;
  height: 80px;
}

.success-anim-circle {
  fill: none;
  stroke: var(--success);
  stroke-width: 3;
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  transform-origin: center;
  animation: drawCircle 300ms ease-out forwards;
}

.success-anim-check {
  fill: none;
  stroke: var(--success);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: drawCheck 200ms ease-out 300ms forwards;
}

.success-anim-circle.explode {
  animation: drawCircle 300ms ease-out forwards, explodeCircle 200ms ease-out 500ms forwards;
}

.success-anim-particle {
  fill: var(--accent);
  opacity: 0;
  animation: particle 400ms ease-out 500ms forwards;
}

.success-anim-particle:nth-child(odd) { fill: var(--success); }
.success-anim-particle:nth-child(3n) { fill: #8b5cf6; }

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

@keyframes explodeCircle {
  to { opacity: 0; transform: scale(1.15); }
}

@keyframes particle {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: var(--particle-dir) scale(0); }
}

@keyframes checkBounce {
  0% { transform: scale(1); }
  25% { transform: scale(0.95); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.success-anim-check.bounce {
  animation: drawCheck 200ms ease-out 300ms forwards, checkBounce 200ms ease-out 700ms forwards;
}

/* ===== ERROR VIEW ===== */
.error-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--error), #dc2626);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

/* ===== FILE PREVIEW ===== */
.preview-container {
  margin-bottom: 16px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.preview-image {
  max-height: 200px;
  max-width: 100%;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.preview-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.preview-icon-pdf { background: rgba(239, 68, 68, 0.1); color: var(--error); }
.preview-icon-doc { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.preview-icon-default { background: var(--accent-bg); color: var(--accent); }

.preview-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ===== DOWNLOAD PROGRESS ===== */
.download-progress {
  width: 100%;
  margin-bottom: 16px;
}

.download-progress .progress-bar-container {
  margin-bottom: 8px;
}

.download-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ===== PLUS CARD ===== */
.plus-card {
  width: 100%;
  background: var(--accent-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 24px;
  text-align: center;
}

.plus-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.plus-badge {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 0.08em;
}

.plus-price {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.plus-features {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ===== ACCOUNT VIEW ===== */
.account-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.account-avatar-img {
  border-radius: 50%;
  border: 3px solid var(--accent);
  margin-bottom: 12px;
}

.account-section {
  width: 100%;
  margin-bottom: 24px;
}

.account-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.account-plan-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.account-plan-name-plus {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.account-plan-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.account-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

/* ===== TRANSFER HISTORY ===== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.history-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.8rem;
}

.history-info {
  flex: 1;
  min-width: 0;
}

.history-filename {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.history-status-active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.history-status-downloaded {
  background: var(--accent-light);
  color: var(--accent);
}

.history-status-expired {
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.history-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 16px 0;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 200ms ease-out;
}

.modal-overlay[hidden] { display: none; }

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

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  text-align: center;
  animation: modalEnter 300ms ease-out;
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal-close:hover { color: var(--text-primary); }

.modal-logo {
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.google-signin-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  min-height: 44px;
}

.modal-footer-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
  width: calc(100% - 32px);
  pointer-events: none;
}

.toast {
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 300ms ease-out;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-success { background: var(--success); color: white; }
.toast-error { background: var(--error); color: white; }
.toast-info { background: var(--accent); color: white; }

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

.toast-out {
  animation: toastOut 200ms ease-in forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px); }
}

/* ===== DRAG & DROP OVERLAY ===== */
.drop-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(99, 102, 241, 0.08);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.drop-overlay.active {
  display: flex;
}

.drop-overlay-content {
  background: var(--bg-card);
  border: 3px dashed var(--accent);
  border-radius: var(--radius-lg);
  padding: 48px 64px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: dashOffset 1s linear infinite;
}

@keyframes dashOffset {
  to { border-color: #8b5cf6; }
}

.drop-overlay-content p {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

/* ===== AD SLOTS ===== */
.ad-slot {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  position: relative;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot::before {
  content: "Publicidad";
  position: absolute;
  top: -18px;
  left: 12px;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.ad-slot:empty {
  min-height: 0;
  padding: 0;
  border: none;
  background: none;
}

.ad-slot:empty::before { display: none; }

.ad-banner-bottom {
  max-width: 728px;
  margin-top: 32px;
  min-height: 90px;
}

.ad-banner-mid {
  max-width: 440px;
  margin-top: 24px;
  min-height: 100px;
}

.ad-banner-inline {
  max-width: 680px;
  margin: 32px auto;
  min-height: 90px;
}

.ad-sidebar {
  display: none;
}

/* Hide ads for Plus users or users with ads disabled by admin */
body.is-plus .ad-slot,
body.is-plus .ad-sidebar,
body.no-ads .ad-slot,
body.no-ads .ad-sidebar {
  display: none !important;
}

@media (min-width: 1024px) {
  .ad-sidebar {
    display: flex;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    min-height: 600px;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    align-items: center;
    justify-content: center;
    z-index: 10;
  }
  .ad-sidebar-right { right: 20px; }
  .ad-sidebar-left { left: 20px; }
  .ad-sidebar::before {
    content: "Publicidad";
    position: absolute;
    top: 8px;
    left: 12px;
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
  }
  body.is-plus .ad-sidebar,
  body.no-ads .ad-sidebar { display: none !important; }
}

@media (max-width: 480px) {
  .ad-banner-bottom { min-height: 50px; }
}

/* ===== SEO CONTENT ===== */
.seo-content {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 48px 20px;
  margin-top: auto;
}

.seo-inner {
  max-width: 680px;
  margin: 0 auto;
}

.seo-content h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.seo-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 28px;
  margin-bottom: 10px;
}

.seo-content p,
.seo-content ol,
.seo-content li {
  font-size: 0.938rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.seo-content ol {
  padding-left: 20px;
  margin-bottom: 8px;
}

.seo-content li { margin-bottom: 6px; }

.seo-content details {
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 16px 0;
  margin-bottom: 0;
  background: transparent;
}

.seo-content details:first-of-type {
  border-top: 1px solid var(--border);
}

.seo-content summary {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
}

.seo-content summary::-webkit-details-marker { display: none; }
.seo-content summary::before { content: '+ '; color: var(--accent); font-weight: 700; }
.seo-content details[open] summary::before { content: '− '; }
.seo-content details p { margin-top: 10px; }

/* ===== SITE FOOTER ===== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer .footer-links {
  margin-top: 4px;
}

.site-footer .footer-links a {
  margin: 0 6px;
}

/* ===== LEGAL PAGES ===== */
.legal-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.legal-page h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.legal-page .legal-updated {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.legal-page h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 28px;
  margin-bottom: 8px;
}

.legal-page p,
.legal-page ul,
.legal-page li {
  font-size: 0.938rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.legal-page ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.legal-page li { margin-bottom: 4px; }

/* ===== RESPONSIVE ===== */
@media (min-width: 480px) {
  .app-container { padding: 32px 24px 48px; }

  .qr-container canvas,
  .qr-container img {
    width: 220px !important;
    height: 220px !important;
  }

  .otp-input {
    width: 68px;
    height: 76px;
    font-size: 1.75rem;
  }
}

@media (min-width: 768px) {
  /* reserved */
}

@media (max-width: 360px) {
  .otp-input {
    width: 52px;
    height: 60px;
    font-size: 1.25rem;
  }
  .code-text { font-size: 1.5rem; }
}
