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

html {
  font-size: 16px;
}

body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 22px;
  color: #14213D;
  background-color: #EEF1F6;
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

/* ---------- Cabecera ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background-color: #2F5BFF;
  box-shadow: inset 0 0 0 7px #2F5BFF, inset 0 0 0 14px #EEF1F6;
}

h1 {
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.tagline {
  font-size: 15px;
  color: #5B6781;
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 24px 48px;
  align-items: start;
}

.layout > *,
.group > * {
  min-width: 0;
}

.panel,
.result {
  background-color: #FFFFFF;
  border: 1px solid #DDE2EC;
  border-radius: 16px;
  padding: 8px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.group-title {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: #14213D;
}

.result .group-title {
  margin: 28px 0 12px;
}

/* ---------- Pestañas y segmentado ---------- */
.tabs,
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  background-color: #EEF1F6;
  border-radius: 12px;
}

.tab,
.seg {
  flex: 1;
  padding: 9px 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #5B6781;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.tab:hover,
.seg:hover {
  color: #14213D;
}

.tab.is-active,
.seg.is-active {
  color: #14213D;
  background-color: #FFFFFF;
  box-shadow: 0 1px 3px #14213D26;
}

/* ---------- Campos ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.label {
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
  color: #5B6781;
}

.label output {
  margin-left: 6px;
  color: #2F5BFF;
}

input[type="text"],
select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  color: #14213D;
  background-color: #FFFFFF;
  border: 1px solid #C9D0DE;
  border-radius: 10px;
}

input[type="text"] {
  font-size: 18px;
  font-weight: 600;
}

.color-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-field input[type="text"] {
  flex: 1;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
}

.color-field input[type="text"].is-invalid {
  border-color: #D92D20;
}

.swatch {
  width: 48px;
  height: 42px;
  flex-shrink: 0;
  background-color: #FFFFFF;
  border: 1px solid #C9D0DE;
  border-radius: 10px;
  box-shadow: inset 0 0 0 3px #FFFFFF;
  cursor: pointer;
}

.swatch:hover {
  border-color: #2F5BFF;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  accent-color: #2F5BFF;
  cursor: pointer;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: #2F5BFF;
}

:focus-visible {
  outline: 2px solid #2F5BFF;
  outline-offset: 2px;
}

.range-field {
  display: flex;
  align-items: center;
  gap: 16px;
}

.range-field input[type="range"] {
  flex: 1;
  min-width: 0;
}

input[type="number"] {
  width: 72px;
  padding: 8px 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  color: #14213D;
  background-color: #FFFFFF;
  border: 1px solid #C9D0DE;
  border-radius: 10px;
}

/* ---------- Selector de color ---------- */
.picker {
  position: absolute;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 248px;
  padding: 14px;
  background-color: #FFFFFF;
  border: 1px solid #DDE2EC;
  border-radius: 14px;
  box-shadow: 0 12px 32px #14213D33;
}

.picker-hex {
  display: flex;
  align-items: center;
  gap: 10px;
}

.picker-hex span {
  font-size: 13px;
  font-weight: 700;
  color: #5B6781;
}

.picker-hex input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
}

.picker-sv {
  position: relative;
  height: 150px;
  border-radius: 8px;
  background-color: #FF0000;
  background-image:
    linear-gradient(to top, #000000, #00000000),
    linear-gradient(to right, #FFFFFF, #FFFFFF00);
  cursor: crosshair;
  touch-action: none;
}

.picker-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #14213D66, 0 1px 4px #14213D66;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.picker-hue {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right, #FF0000, #FFFF00, #00FF00, #00FFFF, #0000FF, #FF00FF, #FF0000);
}

.picker-hue::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background-color: #FFFFFF;
  border: 2px solid #14213D;
  border-radius: 50%;
}

.picker-hue::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background-color: #FFFFFF;
  border: 2px solid #14213D;
  border-radius: 50%;
}

/* ---------- Zona de imagen ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 28px 16px;
  text-align: center;
  background-color: #F7F9FC;
  border: 2px dashed #C9D0DE;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.dropzone:hover,
.dropzone.is-over {
  border-color: #2F5BFF;
  background-color: #EEF2FF;
}

.dropzone-title {
  font-size: 15px;
  font-weight: 600;
}

.dropzone-hint {
  font-size: 13px;
  color: #5B6781;
}

/* ---------- Escenario ---------- */
.stage {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 24px;
  padding: 32px 24px;
  background-color: #14213D;
  border-radius: 12px;
}

.stage-canvas {
  width: 208px;
  height: 208px;
  border-radius: 16px;
  background-color: #FFFFFF;
  background-image:
    linear-gradient(45deg, #E3E7EF 25%, #00000000 25%, #00000000 75%, #E3E7EF 75%),
    linear-gradient(45deg, #E3E7EF 25%, #00000000 25%, #00000000 75%, #E3E7EF 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  overflow: hidden;
}

.stage-canvas canvas {
  display: block;
  width: 208px;
  height: 208px;
}

.browser {
  width: 220px;
}

.browser-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #14213D;
  background-color: #FFFFFF;
  border-radius: 10px 10px 0 0;
}

.browser-tab canvas {
  width: 16px;
  height: 16px;
}

/* ---------- Botones ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.btn {
  padding: 11px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #14213D;
  background-color: #FFFFFF;
  border: 1px solid #C9D0DE;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn:hover {
  border-color: #2F5BFF;
  background-color: #F4F7FF;
}

.btn-primary {
  color: #FFFFFF;
  background-color: #2F5BFF;
  border-color: #2F5BFF;
}

.btn-primary:hover {
  background-color: #1F45D6;
  border-color: #1F45D6;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

/* ---------- Tamaños ---------- */
.sizes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}

.size-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 8px 12px;
  background-color: #F7F9FC;
  border: 1px solid #DDE2EC;
  border-radius: 12px;
}

.size-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
}

.size-thumb canvas {
  max-width: 96px;
  max-height: 96px;
}

.size-name {
  font-size: 13px;
  font-weight: 600;
}

.size-use {
  font-size: 12px;
  line-height: 16px;
  color: #5B6781;
  text-align: center;
}

/* ---------- Anuncio ---------- */
.ad-slot {
  width: 100%;
  max-width: 100%;
  min-height: 100px;
  overflow: hidden;
  text-align: center;
}

.ad-slot .adsbygoogle {
  display: block;
  width: 100%;
  margin: 0 auto;
}

/* ---------- Código ---------- */
.code {
  position: relative;
  margin-top: 16px;
  background-color: #14213D;
  border-radius: 12px;
}

.code pre {
  padding: 20px 88px 20px 20px;
  overflow-x: auto;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
  line-height: 22px;
  color: #D6DEF5;
}

.code .btn {
  position: absolute;
  top: 12px;
  right: 12px;
}

/* ---------- Información ---------- */
.info {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

.info-card {
  padding: 36px 40px;
  background-color: #FFFFFF;
  border: 1px solid #DDE2EC;
  border-radius: 16px;
}

.info-card h2 {
  margin-bottom: 16px;
  font-size: 24px;
  line-height: 32px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.info-card h3 {
  margin: 32px 0 12px;
  font-size: 18px;
  line-height: 26px;
  font-weight: 700;
}

.info-card h4 {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 22px;
  font-weight: 700;
}

.info-card p,
.info-card li {
  font-size: 15px;
  line-height: 25px;
  color: #3B4660;
}

.info-card p + p,
.info-card p + .uses,
.info-card .uses + p {
  margin-top: 12px;
}

.info-card strong {
  color: #14213D;
}

.info-card code {
  padding: 2px 6px;
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
  color: #1F45D6;
  background-color: #EEF2FF;
  border-radius: 6px;
}

.steps,
.uses {
  margin: 16px 0 0;
  padding-left: 22px;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.uses {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}

.steps li::marker {
  font-weight: 700;
  color: #2F5BFF;
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.download-option {
  padding: 20px;
  background-color: #F7F9FC;
  border: 1px solid #DDE2EC;
  border-radius: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .download-grid {
    grid-template-columns: 1fr;
  }

  .info-card {
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
