/* ============================================================
   hasclic.com — Design System
   Neumorfismo / Soft UI + Material Design 3
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* ── Tokens globales ── */
:root {
  font-family: 'Inter', system-ui, sans-serif;

  /* Radio */
  --radius-sm:   8px;
  --radius-md:   16px;
  --radius-lg:   24px;
  --radius-xl:   32px;
  --radius-full: 9999px;

  /* Elevación clásica (fallback) */
  --elevation-1: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.10);
  --elevation-2: 0 3px 6px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.08);
  --elevation-3: 0 8px 24px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
  --elevation-4: 0 12px 40px rgba(0,0,0,.10), 0 6px 16px rgba(0,0,0,.08);
  --elevation-5: 0 24px 64px rgba(0,0,0,.12), 0 12px 24px rgba(0,0,0,.10);

  /* Neumorfismo — luz */
  --nm-bg:          #e8ecf1;
  --nm-dark:        #c5cad3;
  --nm-light:       #ffffff;
  --nm-raised:      8px 8px 18px var(--nm-dark), -8px -8px 18px var(--nm-light);
  --nm-raised-sm:   4px 4px 10px var(--nm-dark), -4px -4px 10px var(--nm-light);
  --nm-inset:       inset 5px 5px 12px var(--nm-dark), inset -5px -5px 12px var(--nm-light);
  --nm-float:       12px 12px 28px var(--nm-dark), -12px -12px 28px var(--nm-light);

  /* Velocidad de transición */
  --motion-swift:   cubic-bezier(0.34,1.56,0.64,1);
  --motion-smooth:  cubic-bezier(0.2,0,0,1);
  --motion-bounce:  cubic-bezier(0.68,-0.55,0.27,1.55);
}

/* ── MD3 paleta base — LIGHT ── */
:root,
:root.light,
:root[data-theme-mode="light"] {
  --md-sys-color-background:               #e8ecf1;
  --md-sys-color-on-background:            #1a1c1e;
  --md-sys-color-surface:                  #f0f3f8;
  --md-sys-color-on-surface:               #1a1c1e;
  --md-sys-color-surface-variant:          #dde1e7;
  --md-sys-color-on-surface-variant:       #44474e;
  --md-sys-color-outline:                  #74777f;
  --md-sys-color-outline-variant:          #c4c6ce;
  --md-sys-color-surface-container-low:    #eef1f6;
  --md-sys-color-surface-container:        #e4e8ed;
  --md-sys-color-surface-container-high:   #dde1e7;
  --md-sys-color-surface-container-highest:#d6dae0;
  --md-sys-color-error:                    #ba1a1a;
  --md-sys-color-on-error:                 #ffffff;
  --md-sys-color-error-container:          #ffdad6;
}

/* ── MD3 paleta base — DARK ── */
:root.dark,
:root[data-theme-mode="dark"] {
  --md-sys-color-background:               #1a1d22;
  --md-sys-color-on-background:            #e2e2e6;
  --md-sys-color-surface:                  #1e2128;
  --md-sys-color-on-surface:               #e2e2e6;
  --md-sys-color-surface-variant:          #2a2d33;
  --md-sys-color-on-surface-variant:       #c4c6ce;
  --md-sys-color-outline:                  #8d9199;
  --md-sys-color-outline-variant:          #3a3d43;
  --md-sys-color-surface-container-low:    #20232a;
  --md-sys-color-surface-container:        #24272e;
  --md-sys-color-surface-container-high:   #2c2f36;
  --md-sys-color-surface-container-highest:#34373e;
  --md-sys-color-error:                    #ffb4ab;
  --md-sys-color-on-error:                 #690005;
  --md-sys-color-error-container:          #93000a;

  /* Neumorfismo dark */
  --nm-bg:    #1e2229;
  --nm-dark:  #14171d;
  --nm-light: #282d35;
}

/* ── MD3 colores primarios (override por tema) ── */
.theme-colors {
  --md-sys-color-primary:                  #0061a4;
  --md-sys-color-on-primary:               #ffffff;
  --md-sys-color-primary-container:        #d1e4ff;
  --md-sys-color-on-primary-container:     #001d36;
  --md-sys-color-secondary:                #535f70;
  --md-sys-color-on-secondary:             #ffffff;
  --md-sys-color-secondary-container:      #d7e3f7;
  --md-sys-color-on-secondary-container:   #101c2b;
  --md-sys-color-tertiary:                 #6b5778;
  --md-sys-color-on-tertiary:              #ffffff;
  --md-sys-color-tertiary-container:       #f2dafd;
  --md-sys-color-on-tertiary-container:    #251431;
  transition: all 0.5s var(--motion-smooth);
}

/* ── Transiciones de tema ── */
body,
.nm-card, .nm-pill, .nm-btn,
.top-bar, .plan-card, .feature-card,
.btn-primary, .btn-secondary, .nav-btn,
.modal-content {
  transition:
    background-color 0.5s var(--motion-smooth),
    color 0.5s var(--motion-smooth),
    box-shadow 0.5s var(--motion-smooth),
    border-color 0.4s var(--motion-smooth);
}

/* ============================================================
   BASE
   ============================================================ */
body {
  background: var(--nm-bg);
  color: var(--md-sys-color-on-background);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

a { color: var(--md-sys-color-primary); text-decoration: none; }
a:hover { opacity: .85; }

/* ============================================================
   TIPOGRAFÍA UTILITARIA
   ============================================================ */
.text-gradient {
  background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--md-sys-color-on-background);
  text-align: center;
  letter-spacing: -0.5px;
}
.section-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  margin-bottom: .8rem;
}
.section-sub {
  font-size: 1rem;
  color: var(--md-sys-color-on-surface-variant);
  text-align: center;
  max-width: 560px;
  margin: .6rem auto 0;
  line-height: 1.65;
}

/* ============================================================
   NEUMORPHISM UTILITIES
   ============================================================ */

/* Superficie elevada */
.nm-card {
  background: var(--nm-bg);
  box-shadow: var(--nm-raised);
  border-radius: var(--radius-xl);
}
.nm-card-sm {
  background: var(--nm-bg);
  box-shadow: var(--nm-raised-sm);
  border-radius: var(--radius-lg);
}
/* Superficie hundida */
.nm-inset {
  background: var(--nm-bg);
  box-shadow: var(--nm-inset);
  border-radius: var(--radius-lg);
}
/* Superficie flotante (mayor profundidad) */
.nm-float {
  background: var(--nm-bg);
  box-shadow: var(--nm-float);
  border-radius: var(--radius-xl);
}

/* ============================================================
   BOTONES
   ============================================================ */

/* Primario — elevado neumórfico */
.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  background: linear-gradient(145deg, var(--md-sys-color-primary), color-mix(in srgb, var(--md-sys-color-primary) 80%, #000));
  color: var(--md-sys-color-on-primary);
  font-weight: 700;
  font-size: .95rem;
  border: none;
  cursor: pointer;
  box-shadow: 4px 4px 12px rgba(0,97,164,.4), -2px -2px 8px rgba(255,255,255,.15);
  overflow: hidden;
  transition: transform .25s var(--motion-swift), box-shadow .25s var(--motion-smooth);
  min-height: 48px;
  min-width: 48px;
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 6px 8px 20px rgba(0,97,164,.45), -2px -2px 8px rgba(255,255,255,.15);
}
.btn-primary:active {
  transform: translateY(0) scale(.98);
  box-shadow: 2px 2px 6px rgba(0,97,164,.3);
}

/* Secundario — contorno neumórfico */
.btn-secondary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  background: var(--nm-bg);
  color: var(--md-sys-color-primary);
  font-weight: 600;
  font-size: .95rem;
  border: none;
  cursor: pointer;
  box-shadow: var(--nm-raised-sm);
  overflow: hidden;
  transition: transform .25s var(--motion-swift), box-shadow .25s var(--motion-smooth), color .3s;
  min-height: 48px;
  min-width: 48px;
}
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--nm-raised);
  color: var(--md-sys-color-tertiary);
}
.btn-secondary:active {
  box-shadow: var(--nm-inset);
  transform: translateY(0);
}

/* Contornos */
.btn-outlined {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--md-sys-color-primary);
  font-weight: 600;
  font-size: .9rem;
  border: 1.5px solid var(--md-sys-color-primary);
  cursor: pointer;
  transition: all .25s var(--motion-smooth);
  min-height: 48px;
}
.btn-outlined:hover {
  background: var(--md-sys-color-primary-container);
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Ripple effect */
.ripple-container { position: relative; overflow: hidden; }
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple-anim .55s linear;
  background: rgba(255,255,255,.35);
  pointer-events: none;
}
@keyframes ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

/* ============================================================
   TOP BAR
   ============================================================ */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: var(--nm-bg);
  box-shadow: 0 4px 16px var(--nm-dark), 0 -1px 0 var(--nm-light);
  backdrop-filter: blur(12px);
}
.top-bar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--md-sys-color-primary);
  letter-spacing: -0.3px;
  text-decoration: none;
}
.top-bar .nav-right { display: flex; align-items: center; gap: 8px; }
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  background: var(--nm-bg);
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 600;
  font-size: .85rem;
  border: none;
  cursor: pointer;
  box-shadow: var(--nm-raised-sm);
  transition: all .25s var(--motion-swift);
  min-height: 48px;
}
.nav-btn:hover { transform: translateY(-1px); box-shadow: var(--nm-raised); color: var(--md-sys-color-primary); }
.nav-btn.primary {
  background: linear-gradient(145deg, var(--md-sys-color-primary), color-mix(in srgb, var(--md-sys-color-primary) 80%, #000));
  color: var(--md-sys-color-on-primary);
  box-shadow: 3px 3px 10px rgba(0,97,164,.4);
}
.nav-btn.primary:hover { transform: translateY(-1px); box-shadow: 4px 6px 16px rgba(0,97,164,.45); }

.theme-toggle {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--nm-bg);
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--nm-raised-sm);
  transition: all .25s var(--motion-swift);
}
.theme-toggle:hover { box-shadow: var(--nm-raised); color: var(--md-sys-color-primary); transform: rotate(20deg); }
.theme-toggle:active { box-shadow: var(--nm-inset); transform: rotate(0deg); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(6px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--motion-smooth);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-content {
  background: var(--nm-bg);
  box-shadow: var(--nm-float);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 460px;
  transform: translateY(24px) scale(.97);
  transition: transform .35s var(--motion-swift);
}
.modal-overlay.open .modal-content {
  transform: translateY(0) scale(1);
}

/* Campos de formulario */
label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 6px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--nm-bg);
  color: var(--md-sys-color-on-surface);
  font-size: .95rem;
  font-family: inherit;
  box-shadow: var(--nm-inset);
  outline: none;
  transition: box-shadow .25s var(--motion-smooth);
  min-height: 48px;
}
input:focus, textarea:focus, select:focus {
  box-shadow: var(--nm-inset), 0 0 0 2px var(--md-sys-color-primary);
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--nm-bg);
  box-shadow: var(--nm-raised);
  color: var(--md-sys-color-on-surface);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: .9rem;
  font-weight: 600;
  z-index: 9999;
  transition: transform .4s var(--motion-swift), opacity .3s;
  opacity: 0;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: var(--md-sys-color-primary); color: var(--md-sys-color-on-primary); }
.toast.error { background: var(--md-sys-color-error-container); color: var(--md-sys-color-error); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 750px) {
  .top-bar { padding: 0 1rem; }
  .top-bar .nav-btn .label { display: none; }
  .modal-content { padding: 1.5rem; }
}
@media (max-width: 480px) {
  .top-bar .brand span.material-symbols-outlined { font-size: 20px; }
}
