:root {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  color: #f1f7f4;
  background: #07100d;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
  --text: #f1f7f4;
  --muted: #a8b9b2;
  --muted-2: #7f948b;
  --line: rgba(211, 246, 233, 0.14);
  --glass: rgba(20, 42, 35, 0.42);
  --glass-strong: rgba(27, 66, 54, 0.56);
  --accent: #82ddbd;
  --accent-strong: #54c99f;
  --danger: #ff9c91;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(110% 75% at 12% -4%, rgba(51, 151, 118, 0.30) 0%, rgba(20, 71, 56, 0.13) 34%, transparent 62%),
    radial-gradient(90% 65% at 95% 20%, rgba(23, 91, 69, 0.20) 0%, transparent 64%),
    linear-gradient(155deg, #172a23 0%, #0d1a16 38%, #09120f 68%, #050908 100%);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell {
  min-height: 100svh;
  display: grid;
  place-items: start center;
  padding: max(28px, env(safe-area-inset-top)) 16px max(34px, env(safe-area-inset-bottom));
}

.card {
  position: relative;
  isolation: isolate;
  width: min(100%, 720px);
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(211, 246, 233, 0.14);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(29, 48, 41, 0.70), rgba(8, 18, 15, 0.76));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 24px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(26px) saturate(125%);
  -webkit-backdrop-filter: blur(26px) saturate(125%);
}

.card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(70% 40% at 10% 0%, rgba(137, 239, 202, 0.08), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,0.025), transparent 28%);
}

.header {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 30px;
}

.app-icon {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(214, 255, 239, 0.20);
  border-radius: 17px;
  color: #f5fff9;
  background:
    linear-gradient(145deg, rgba(113, 224, 185, 0.42), rgba(14, 91, 67, 0.50));
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 -12px 24px rgba(4, 46, 33, 0.18),
    0 12px 30px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

h1, h2, h3, p { margin: 0; }

h1 {
  font-size: 29px;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

label {
  display: block;
  margin: 0 0 9px 3px;
  font-size: 14px;
  font-weight: 680;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 15px;
  border: 1px solid rgba(213, 245, 234, 0.15);
  border-radius: 16px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  color: var(--text);
  background: rgba(7, 18, 14, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.10);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

input::placeholder { color: #72867e; }

input:focus {
  border-color: rgba(130, 221, 189, 0.54);
  box-shadow:
    0 0 0 4px rgba(83, 201, 158, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.glass-button {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(205, 250, 232, 0.18);
  border-radius: 16px;
  cursor: pointer;
  color: #eafff6;
  background:
    linear-gradient(145deg, rgba(91, 185, 153, 0.24), rgba(18, 75, 57, 0.26));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -10px 22px rgba(0, 35, 24, 0.12),
    0 10px 28px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(20px) saturate(145%);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
  text-decoration: none;
  font-weight: 740;
  transition: transform 120ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.glass-button::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(80% 60% at 20% 0%, rgba(255,255,255,0.13), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,0.045), transparent 52%);
}

.glass-button:hover {
  border-color: rgba(209, 255, 238, 0.28);
  background:
    linear-gradient(145deg, rgba(100, 204, 168, 0.30), rgba(22, 87, 66, 0.30));
}

.glass-button:active { transform: translateY(1px) scale(0.995); }

.glass-primary {
  min-height: 52px;
  padding: 0 20px;
  background:
    linear-gradient(145deg, rgba(89, 215, 169, 0.50), rgba(15, 109, 78, 0.48));
  border-color: rgba(195, 255, 233, 0.25);
}

.form-message {
  min-height: 19px;
  margin: 8px 2px 0;
  color: var(--danger);
  font-size: 13px;
}

.results {
  margin-top: 24px;
  padding-top: 25px;
  border-top: 1px solid var(--line);
}

.results-heading {
  text-align: center;
  margin-bottom: 16px;
}

.results-heading h2 {
  font-size: clamp(23px, 4.8vw, 27px);
  line-height: 1.18;
  letter-spacing: -0.035em;
}

#results-query {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.open-all-area {
  display: grid;
  justify-items: center;
  gap: 9px;
  margin-bottom: 20px;
}

.secondary {
  min-height: 48px;
  padding: 0 21px;
  white-space: nowrap;
  font-size: 15px;
}

.popup-note {
  width: min(100%, 520px);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
}

.store-list {
  display: grid;
  gap: 10px;
}

.store-link {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  font-size: 15px;
}

.store-link::after,
.preview-open-link::after {
  content: "↗";
  position: relative;
  z-index: 1;
  color: var(--accent);
  font-size: 18px;
}

.previews {
  margin-top: 32px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.previews-heading {
  margin-bottom: 16px;
  text-align: center;
}

.previews-heading h2 {
  font-size: 20px;
  letter-spacing: -0.025em;
}

.previews-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.preview-list {
  display: grid;
  gap: 20px;
}

.preview-card {
  overflow: hidden;
  border: 1px solid rgba(211, 246, 233, 0.15);
  border-radius: 22px;
  background:
    linear-gradient(150deg, rgba(18, 38, 32, 0.55), rgba(6, 15, 12, 0.68));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 16px 44px rgba(0, 0, 0, 0.17);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.preview-card-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 17px;
  border-bottom: 1px solid rgba(211, 246, 233, 0.12);
}

.preview-card h3 {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.preview-status {
  flex: 0 0 auto;
  color: var(--muted-2);
  font-size: 12px;
}

.preview-body {
  min-height: 190px;
}

.preview-pending,
.preview-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.preview-frame-shell {
  position: relative;
  min-height: 430px;
  background: #fff;
}

.preview-frame {
  display: block;
  width: 100%;
  height: min(62vh, 620px);
  min-height: 430px;
  border: 0;
  background: #fff;
  opacity: 0;
  transition: opacity 180ms ease;
}

.preview-frame.is-loaded { opacity: 1; }

.preview-loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #101d18;
  pointer-events: none;
}

.preview-loading[hidden] { display: none; }

.preview-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid rgba(183, 226, 210, 0.20);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: preview-spin 0.8s linear infinite;
}

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

.preview-unavailable {
  min-height: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 22px;
  text-align: center;
  background:
    radial-gradient(70% 80% at 50% 0%, rgba(55, 139, 108, 0.11), transparent 75%),
    rgba(5, 14, 11, 0.32);
}

.preview-unavailable-symbol {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(205, 250, 232, 0.14);
  border-radius: 15px;
  color: var(--accent);
  background: rgba(61, 144, 113, 0.10);
  font-size: 23px;
}

.preview-unavailable-message {
  width: min(100%, 430px);
  color: #c4d2cd;
  font-size: 15px;
  line-height: 1.5;
}

.preview-open-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 17px;
  font-size: 14px;
}

@media (max-width: 520px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .card { padding: 19px; border-radius: 24px; }
  .search-row { grid-template-columns: 1fr; }
  #search-button { width: 100%; }
  .preview-frame-shell,
  .preview-frame { min-height: 500px; }
  .preview-frame { height: 68vh; }
  .preview-card-header { padding-left: 14px; padding-right: 14px; }
  .preview-card h3 { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* v10 — marca visual e acabamento de vidro mais evidente */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 5%, rgba(65, 196, 151, 0.16), transparent 31rem),
    radial-gradient(circle at 88% 28%, rgba(29, 109, 84, 0.13), transparent 34rem),
    linear-gradient(180deg, rgba(255,255,255,0.018), transparent 28%);
  z-index: -1;
}

.glass-button,
.store-link,
.preview-open-link {
  border: 1px solid rgba(222, 255, 243, 0.20);
  background:
    linear-gradient(145deg, rgba(108, 211, 174, 0.24), rgba(21, 78, 60, 0.23));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    inset 0 -1px 0 rgba(0,0,0,0.16),
    0 10px 28px rgba(0,0,0,0.20);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.version-top {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 2;
  color: rgba(213, 231, 224, 0.34);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  user-select: none;
  pointer-events: none;
}
