:root {
  --blue: #00b1e7;
  --blue-dark: #007da8;
  --ink: #10212b;
  --muted: #58707d;
  --line: #dbe9ef;
  --soft: #f1faff;
  --white: #ffffff;
  --danger: #a82b2b;
  --danger-bg: #fff2f2;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f8fbfc;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% 0%, #e5f9ff 0, transparent 35%), #f8fbfc; }
body.modal-open { overflow: hidden; }
button, input { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.page-shell { width: min(1040px, calc(100% - 32px)); margin: 0 auto; }
.hero { padding: 38px 0 34px; max-width: 850px; }
.brand { display: inline-flex; color: var(--blue-dark); font-size: 1.2rem; font-weight: 900; text-decoration: none; letter-spacing: -0.04em; margin-bottom: 42px; }
.eyebrow, .step-kicker { color: var(--blue-dark); font-size: .76rem; font-weight: 850; letter-spacing: .15em; }
h1 { max-width: 760px; margin: 12px 0 16px; font-size: clamp(2.35rem, 6vw, 4.7rem); line-height: .98; letter-spacing: -.06em; }
.hero-copy { max-width: 720px; margin: 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.24rem); line-height: 1.6; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.trust-row span { border: 1px solid #bfe6f3; background: rgba(255,255,255,.78); border-radius: 999px; padding: 8px 13px; color: #315765; font-size: .86rem; font-weight: 700; }

.ad-slot { display: grid; place-items: center; position: relative; margin: 0 auto 24px; border: 1px dashed #c9dce3; border-radius: 13px; color: #8799a0; background: rgba(255,255,255,.72); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.ad-slot--leaderboard { width: min(100%, 970px); min-height: 100px; }
.ad-slot--rectangle { width: min(100%, 720px); min-height: 120px; margin-top: 28px; }

.generator-card { background: var(--white); border: 1px solid var(--line); border-radius: 26px; box-shadow: 0 24px 80px rgba(17,56,72,.10); padding: clamp(24px, 5vw, 52px); }
.card-heading h2, .how-it-works h2 { margin: 6px 0 8px; font-size: clamp(1.65rem, 4vw, 2.65rem); letter-spacing: -.04em; }
.card-heading > p:last-child { color: var(--muted); line-height: 1.55; }
.error-box { margin: 24px 0; padding: 14px 16px; border: 1px solid #efbbbb; border-radius: 12px; color: var(--danger); background: var(--danger-bg); font-weight: 700; }

.field-block { margin-top: 32px; }
.number { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; margin-right: 8px; border-radius: 9px; color: #005f80; background: #d7f4fd; font-size: .83rem; font-weight: 900; }
.field-title { display: flex; align-items: center; font-size: 1.02rem; font-weight: 850; }
.field-help { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.field-block > .field-help { margin: 8px 0 11px 36px; }
.url-control { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 0 16px; border: 1.5px solid #b9dbe6; border-radius: 14px; background: #fbfeff; transition: border-color .2s, box-shadow .2s; }
.url-control:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,177,231,.12); }
.url-control input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 1.04rem; }
.url-control input::placeholder { color: #92a5ad; }

.photo-fieldset, .styles-fieldset { margin: 30px 0 0; padding: 0; border: 0; }
.photo-fieldset legend, .styles-fieldset legend { display: flex; align-items: center; font-weight: 850; }
.photo-fieldset > .field-help { margin: 8px 0 14px 36px; }
.photo-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.photo-action { position: relative; display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; min-height: 92px; padding: 17px; border: 1.5px dashed #9bcfe0; border-radius: 15px; background: var(--soft); cursor: pointer; transition: transform .2s, border-color .2s, background .2s; }
.photo-action:hover { transform: translateY(-2px); border-color: var(--blue); background: #e9f9ff; }
.photo-action input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-icon { grid-row: 1 / 3; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: #006d92; background: #d7f4fd; font-weight: 900; }
.photo-action strong { align-self: end; color: #164858; font-size: .94rem; }
.photo-action small { color: var(--muted); font-size: .78rem; }
.photo-preview-wrap { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfe; }
.photo-preview-wrap img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; }
.photo-preview-wrap div { min-width: 0; }
.photo-preview-wrap strong { display: block; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.photo-preview-wrap button { margin-top: 7px; padding: 0; border: 0; color: var(--blue-dark); background: transparent; font-size: .8rem; font-weight: 800; cursor: pointer; }

.styles-fieldset legend { margin-bottom: 16px; }
.styles-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.style-option { position: relative; display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 13px; color: #39525e; background: #fff; cursor: pointer; font-size: .88rem; font-weight: 750; }
.style-option:has(input:checked) { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: #effbff; color: #075b77; }
.style-option input { position: absolute; opacity: 0; }
.style-symbol { width: 23px; height: 23px; flex: 0 0 23px; background: #173944; }
.style-estrellas { clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 94%,50% 72%,21% 94%,32% 57%,2% 35%,39% 35%); }
.style-corazones { clip-path: polygon(50% 88%,8% 47%,5% 28%,15% 10%,34% 5%,50% 21%,66% 5%,85% 10%,95% 28%,92% 47%); }
.style-palomitas { clip-path: polygon(0 47%,21% 28%,42% 49%,80% 4%,100% 25%,43% 98%); }
.style-circulos { border-radius: 50%; }
.style-cuadritos { border-radius: 4px; transform: scale(.78); }
.style-clasico { background: linear-gradient(90deg,#173944 45%,transparent 45% 55%,#173944 55%), linear-gradient(#173944 45%,transparent 45% 55%,#173944 55%); }
.style-personalizado { border-radius: 48% 52% 64% 36% / 42% 34% 66% 58%; }
.custom-wrap { margin-top: 16px; padding: 18px; border-radius: 14px; background: #f7fbfd; border: 1px solid var(--line); }
.custom-wrap .field-help { margin: 5px 0 12px; }
.custom-wrap input { width: 100%; }

.color-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 26px; padding: 18px 0; border-top: 1px solid var(--line); }
.color-row .field-help { margin: 5px 0 0 36px; }
.color-control { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }
.color-control input { width: 44px; height: 36px; border: 0; padding: 0; background: none; cursor: pointer; }
.color-control output { min-width: 72px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; }

.submit-button, .download-button { display: grid; place-items: center; width: 100%; min-height: 58px; border: 0; border-radius: 14px; padding: 15px 22px; color: #fff; background: linear-gradient(135deg,var(--blue-dark),var(--blue)); box-shadow: 0 12px 30px rgba(0,177,231,.22); font: inherit; font-weight: 900; text-decoration: none; cursor: pointer; }
.submit-button:hover, .download-button:hover { filter: brightness(.96); transform: translateY(-1px); }
.submit-button:disabled { opacity: .72; cursor: wait; transform: none; }
.privacy-note { margin: 12px 0 0; text-align: center; color: #6d838d; font-size: .78rem; }

.how-it-works { padding: 50px 0 70px; }
.steps-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 24px; }
.steps-grid article { display: flex; align-items: center; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.steps-grid strong { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; color: #006d92; background: #d7f4fd; }
.steps-grid span { color: #405b67; font-size: .88rem; font-weight: 750; }
footer { padding: 24px 16px 36px; text-align: center; color: #67808a; font-size: .84rem; }
footer a { color: var(--blue-dark); font-weight: 800; }

.modal { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(9,30,39,.72); backdrop-filter: blur(6px); }
.modal-panel { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0,1fr) 240px; width: min(820px,100%); max-height: calc(100vh - 36px); overflow: auto; border-radius: 22px; background: #fff; box-shadow: 0 30px 100px rgba(0,0,0,.28); }
.modal-close { position: absolute; z-index: 3; top: 10px; right: 10px; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #d5e3e8; border-radius: 50%; color: #3a5661; background: rgba(255,255,255,.94); font-size: 1.65rem; line-height: 1; cursor: pointer; }
.result-content { padding: 34px; text-align: center; }
.result-content h2 { margin: 7px 0; font-size: 2rem; letter-spacing: -.04em; }
.result-url { max-width: 440px; margin: 0 auto 16px; overflow: hidden; color: var(--muted); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }
.result-image { display: block; width: min(100%,390px); aspect-ratio: 1; margin: 0 auto 20px; object-fit: contain; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.modal-ad { position: relative; display: grid; align-content: center; gap: 10px; min-height: 100%; padding: 52px 16px 20px; border-left: 1px solid var(--line); color: #8799a0; background: #f7fafb; text-align: center; font-size: .68rem; letter-spacing: .07em; text-transform: uppercase; }
.ad-placeholder { display: grid; place-items: center; min-height: 250px; border: 1px dashed #c9dce3; border-radius: 10px; background: #fff; }
.ad-close { position: absolute; top: 11px; right: 11px; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #d5e3e8; border-radius: 50%; color: #526b75; background: #fff; font-size: 1.25rem; cursor: pointer; }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 20px,1040px); }
  .hero { padding-top: 24px; }
  .brand { margin-bottom: 30px; }
  .photo-actions, .steps-grid { grid-template-columns: 1fr; }
  .styles-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .color-row { align-items: flex-start; flex-direction: column; }
  .modal { padding: 10px; }
  .modal-panel { grid-template-columns: 1fr; max-height: calc(100vh - 20px); border-radius: 18px; }
  .result-content { padding: 30px 18px 22px; }
  .result-image { width: min(100%,320px); }
  .modal-ad { min-height: 118px; padding: 44px 14px 14px; border-top: 1px solid var(--line); border-left: 0; }
  .ad-placeholder { min-height: 70px; }
}

@media (max-width: 420px) {
  .styles-grid { grid-template-columns: 1fr; }
  .generator-card { border-radius: 20px; padding: 22px 16px; }
  .field-block > .field-help, .photo-fieldset > .field-help { margin-left: 0; }
  .modal-close { top: 7px; right: 7px; }
}
