:root {
  --color-bg: #0f172a;
  --color-surface: rgba(15, 23, 42, 0.6);
  --color-card: rgba(15, 23, 42, 0.92);
  --color-border: rgba(148, 163, 184, 0.2);
  --color-muted: #94a3b8;
  --color-text: #e2e8f0;
  --color-heading: #f8fafc;
  --color-primary: #00a3ff;
  --color-primary-dark: #0081cc;
  --color-positive: #14b8a6;
  --color-warning: #f97316;
  --color-danger: #ef4444;
  --shadow-soft: 0 16px 48px rgba(15, 23, 42, 0.35);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--color-text);
  background: radial-gradient(circle at 20% 20%, rgba(0, 163, 255, 0.25), transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(20, 184, 166, 0.2), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(239, 68, 68, 0.2), transparent 40%),
    var(--color-bg);
  backdrop-filter: blur(3px);
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--color-heading);
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

.hidden {
  display: none !important;
}

.password-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(10, 14, 23, 0.86);
  backdrop-filter: blur(12px);
  z-index: 20;
}

.password-card {
  width: min(420px, 100%);
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.95) 0%,
    rgba(30, 41, 59, 0.92) 100%
  );
  display: grid;
  gap: 24px;
  text-align: center;
}

.password-card .logo {
  width: 140px;
  margin: 0 auto;
}

.unlock-form {
  display: grid;
  gap: 16px;
}

.unlock-form label {
  font-weight: 600;
  justify-self: start;
}

.password-field {
  position: relative;
  display: flex;
}

.password-field input {
  width: 100%;
  padding: 14px 48px 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: rgba(15, 23, 42, 0.85);
  color: var(--color-heading);
  font-size: 16px;
}

.password-field input:focus {
  outline: 2px solid rgba(0, 163, 255, 0.5);
  border-color: transparent;
}

.password-field button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
  padding: 6px;
  display: grid;
  place-items: center;
}

.icon-eye {
  width: 20px;
  height: 20px;
  display: inline-block;
  background: radial-gradient(circle at 50% 50%, currentColor 45%, transparent 45%),
    radial-gradient(circle at 50% 50%, transparent 60%, currentColor 61%),
    linear-gradient(
      to right,
      transparent 35%,
      currentColor 36%,
      currentColor 64%,
      transparent 65%
    );
  border-radius: 999px;
}

.unlock-feedback {
  min-height: 20px;
  font-size: 14px;
  color: var(--color-danger);
}

button {
  font-family: inherit;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #38bdf8 100%);
  color: #0f172a;
  box-shadow: 0 12px 24px rgba(14, 165, 233, 0.35);
}

.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(14, 165, 233, 0.35);
}

.ghost {
  background: transparent;
  color: var(--color-muted);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.ghost:hover {
  border-color: rgba(148, 163, 184, 0.45);
  color: var(--color-heading);
}

.secondary {
  background: rgba(51, 65, 85, 0.8);
  color: var(--color-heading);
}

.secondary:hover {
  background: rgba(71, 85, 105, 0.9);
}

.small {
  padding: 10px 16px;
  font-size: 14px;
}

.app {
  padding: 48px clamp(24px, 5vw, 72px);
  display: grid;
  gap: 36px;
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  justify-content: space-between;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 22px 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(15, 23, 42, 0.65));
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 18px 36px rgba(8, 15, 28, 0.45);
  backdrop-filter: blur(12px);
}

.brand .logo {
  width: 150px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.35));
}

.brand-copy {
  display: grid;
  gap: 8px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--color-muted);
}

.status-pill {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  color: var(--color-muted);
  font-size: 14px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.status-pill.connected {
  background: rgba(20, 184, 166, 0.16);
  color: var(--color-positive);
  border-color: rgba(20, 184, 166, 0.35);
}

.layout {
  display: grid;
  gap: 24px;
  align-items: start;
}

@media screen and (min-width: 1040px) {
  .layout {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 32px;
  }
}

.card {
  padding: clamp(28px, 3vw, 36px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-card);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 24px;
}

.serp-panel {
  gap: 32px;
}

.serp-panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
}

.serp-panel-subtitle {
  color: var(--color-muted);
  margin-top: 6px;
  max-width: 520px;
}

.serp-hint {
  align-self: flex-start;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.5);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.12em;
  display: grid;
  gap: 6px;
  color: var(--color-muted);
}

.serp-hint strong {
  font-size: 16px;
  letter-spacing: normal;
  color: var(--color-heading);
}

.serp-preview-area {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: clamp(12px, 2vw, 18px);
  background: radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.25), transparent 50%),
    radial-gradient(circle at 85% 0%, rgba(14, 165, 233, 0.18), transparent 45%),
    rgba(248, 250, 252, 0.05);
}

.serp-snippet-grid {
  display: grid;
  gap: clamp(18px, 2vw, 24px);
}

@media screen and (min-width: 980px) {
  .serp-snippet-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

.serp-snippet {
  display: grid;
  gap: 12px;
}

.snippet-stage {
  padding: 18px;
  border-radius: 20px;
  background: radial-gradient(circle at 10% 10%, rgba(148, 163, 184, 0.12), transparent 35%),
    #f6f8fc;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 25px 45px rgba(15, 23, 42, 0.1);
  display: grid;
  gap: 16px;
}

.serp-snippet[data-variant='mobile'] .snippet-stage {
  background: radial-gradient(circle at 80% 0, rgba(148, 163, 184, 0.12), transparent 45%),
    #fdfefe;
}

.snippet-searchbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.google-mark {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: #4285f4;
}

.snippet-search-pill {
  padding: 6px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
}

.snippet-search-tools {
  display: flex;
  gap: 4px;
}

.snippet-search-tools span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2e8f0;
}

.snippet-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 15px;
  color: var(--color-muted);
  letter-spacing: 0.02em;
}

.snippet-badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.snippet-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
  padding: 22px 24px;
  color: #202124;
  display: grid;
  gap: 14px;
  font-family: 'Google Sans', 'Roboto', 'Arial', sans-serif;
}

.serp-snippet[data-variant='mobile'] .snippet-card {
  max-width: 360px;
  margin-inline: auto;
  border-radius: 24px;
  padding: 22px 20px;
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.3);
}

.snippet-url-line {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.snippet-favicon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 25% 25%, #eef2ff, #bfdbfe);
}

.snippet-favicon span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #2563eb;
  position: relative;
}

.snippet-favicon span::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: #2563eb;
  right: -5px;
  bottom: -4px;
  transform: rotate(45deg);
}

.snippet-domain-block {
  display: grid;
  gap: 2px;
}

.snippet-meta-line {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #5f6368;
}

.snippet-meta-dot {
  font-size: 16px;
  line-height: 1;
  opacity: 0.6;
}

.snippet-brand-name {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.04em;
}

.snippet-meta-dot {
  opacity: 0.7;
}

.snippet-url {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  color: #188038;
  font-size: 13px;
  letter-spacing: 0.01em;
}

.snippet-url-sep {
  opacity: 0.65;
}

.snippet-menu {
  color: #5f6368;
  font-size: 20px;
  letter-spacing: 0.2em;
}

.snippet-field {
  position: relative;
  border-radius: 8px;
}

.snippet-field.is-overflow::after {
  content: '...';
  position: absolute;
  right: 4px;
  bottom: 6px;
  background: #fff;
  padding-inline: 4px;
  color: #1a0dab;
  font-weight: 600;
  pointer-events: none;
}

.snippet-title {
  font-size: 20px;
  line-height: 1.35;
  color: #1a0dab;
  font-weight: 500;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.serp-snippet[data-variant='mobile'] .snippet-title {
  font-size: 19px;
}

.snippet-description {
  font-size: 14px;
  line-height: 1.6;
  color: #4b5563;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.serp-snippet[data-variant='mobile'] .snippet-description {
  -webkit-line-clamp: 4;
}

.snippet-editor:focus {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
  border-radius: 6px;
  padding: 4px 6px;
  background: rgba(148, 163, 184, 0.12);
}

.snippet-editor[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: rgba(15, 23, 42, 0.25);
}

.snippet-sitelinks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.snippet-sitelinks span {
  flex: 1 1 140px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.12);
}

.serp-snippet[data-variant='mobile'] .snippet-sitelinks {
  display: none;
}

.serp-editor {
  margin-top: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2vw, 28px);
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  gap: 24px;
}

.serp-editor-hint {
  margin: 0;
  font-size: 13px;
  color: var(--color-muted);
}

.serp-editor-field {
  display: grid;
  gap: 12px;
}

.serp-editor-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.serp-editor-field label {
  font-weight: 600;
  font-size: 15px;
}

.serp-editor-field input,
.serp-editor-field textarea {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: var(--color-heading);
}

.serp-editor-field textarea {
  resize: vertical;
}

.serp-loading-overlay {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  display: none;
  gap: 12px;
  place-items: center;
  text-align: center;
  color: #f8fafc;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

.serp-preview-area.is-loading .serp-loading-overlay {
  display: grid;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.serp-loading-core {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(56, 189, 248, 0.95), rgba(56, 189, 248, 0.25));
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.45);
  animation: serp-pulse 1.15s ease-in-out infinite alternate;
}

@keyframes serp-pulse {
  from {
    transform: scale(0.9);
    opacity: 0.8;
  }
  to {
    transform: scale(1.05);
    opacity: 1;
  }
}

.serp-meter-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--color-muted);
}

.serp-meter {
  display: grid;
  gap: 6px;
}

.serp-meter-bar {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.serp-meter-fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  width: 0%;
  background: linear-gradient(90deg, #14b8a6, #f97316, #ef4444);
  transition: width 0.2s ease;
  opacity: 0.9;
}

.serp-meter-fill.good {
  background: linear-gradient(90deg, #22d3ee, #14b8a6);
}

.serp-meter-fill.warning {
  background: linear-gradient(90deg, #facc15, #f97316);
}

.serp-meter-fill.error {
  background: linear-gradient(90deg, #f97316, #ef4444);
}

.serp-status {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: var(--color-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.serp-status.good {
  color: var(--color-positive);
  background: rgba(20, 184, 166, 0.15);
  border-color: rgba(20, 184, 166, 0.35);
}

.serp-status.warning {
  color: var(--color-warning);
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.35);
}

.serp-status.error {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}


.form-card form {
  display: grid;
  gap: 24px;
}

.form-grid {
  display: grid;
  gap: 20px;
}

@media screen and (min-width: 720px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.form-field {
  display: grid;
  gap: 10px;
}

.form-field label {
  font-weight: 600;
  font-size: 15px;
}

input,
textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.65);
  color: var(--color-heading);
  font-size: 15px;
  transition: border 0.2s ease, background 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(15, 23, 42, 0.85);
}

textarea {
  resize: vertical;
  min-height: 140px;
}

.full-width {
  grid-column: 1 / -1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.loader {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 3px solid rgba(15, 23, 42, 0.35);
  border-top-color: rgba(15, 23, 42, 0.85);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.loading .loader {
  opacity: 1;
  transform: scale(1);
  animation: spin 0.75s linear infinite;
}

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

.disclaimer {
  font-size: 13px;
  color: var(--color-muted);
}

.primary.dynamic {
  position: relative;
  overflow: hidden;
}

.primary.dynamic .btn-label {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.primary.dynamic .loading-label {
  position: absolute;
  opacity: 0;
  transform: translateY(8px);
}

.primary.dynamic.loading .default-label {
  opacity: 0;
  transform: translateY(-8px);
}

.primary.dynamic.loading .loading-label {
  opacity: 1;
  transform: translateY(0);
}

.primary.dynamic::after {
  content: '';
  position: absolute;
  inset: -200% 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 35%,
    rgba(56, 189, 248, 0.5) 50%,
    rgba(255, 255, 255, 0.35) 65%,
    transparent 100%
  );
  opacity: 0;
  transform: translateX(-100%);
}

.primary.dynamic.loading::after {
  opacity: 1;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

.results-card {
  gap: 32px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.result-block {
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  gap: 16px;
}

.result-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.meta-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--color-muted);
}

.length-status {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.length-status.good {
  color: var(--color-positive);
  background: rgba(20, 184, 166, 0.15);
  border-color: rgba(20, 184, 166, 0.35);
}

.length-status.warning {
  color: var(--color-warning);
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.35);
}

.length-status.error {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}

.result-content {
  margin: 0;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  line-height: 1.5;
  font-size: 15px;
  min-height: 72px;
  width: 100%;
  resize: vertical;
  color: var(--color-heading);
  font-family: inherit;
  transition: border 0.2s ease, background 0.2s ease;
}

.result-content::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.result-content:focus {
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 2px;
  border-color: rgba(56, 189, 248, 0.6);
  background: rgba(15, 23, 42, 0.9);
}

.copy-btn {
  justify-self: start;
}

.copy-btn.copied {
  background: rgba(20, 184, 166, 0.2);
  color: var(--color-positive);
}

.app-footer {
  text-align: center;
  font-size: 14px;
  color: var(--color-muted);
  padding: 12px 0 32px;
}

@media screen and (max-width: 640px) {
  .app {
    padding: 32px 16px;
  }

  .password-card {
    padding: 36px 24px;
  }

  .brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .results-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .result-heading {
    flex-direction: column;
    align-items: flex-start;
  }
}
