/* ============================================
   Audit Tool — Copper Forge Dark Theme
   ============================================ */

/* --- Tokens --- */
:root {
  --bg-primary: #09090B;
  --bg-surface: #131316;
  --bg-elevated: #1A1A1F;
  --copper: #E07832;
  --copper-light: #F09A5C;
  --copper-dark: #B85E1E;
  --teal: #3DA097;
  --text-primary: #F0F0F2;
  --text-secondary: #88889A;
  --text-tertiary: #555566;
  --border: #222230;
  --red: #E05252;
  --yellow: #E0B852;
  --green: #52C07A;
  --font-headline: 'Outfit', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-data: 'JetBrains Mono', monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--copper); text-decoration: none; }
a:hover { color: var(--copper-light); }
img { max-width: 100%; display: block; }
button, input, select { font-family: inherit; font-size: inherit; }
[hidden] { display: none !important; }

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9,9,11,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header__logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
}
.header__logo-name {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
}
.header__logo-divider {
  color: var(--text-tertiary);
  font-weight: 400;
}
.header__logo-product {
  font-family: var(--font-data);
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--copper);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.header__lang {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  transition: border-color var(--transition);
}
.header__lang:hover { border-color: var(--copper); }
.header__lang-option { font-family: var(--font-data); font-size: 0.75rem; font-weight: 500; }
.header__lang-option.active { color: var(--copper); }
.header__lang-slash { font-size: 0.75rem; }

/* --- Main --- */
.main { flex: 1; }

/* --- Hero --- */
.hero { padding: 80px 24px 60px; }
.hero__inner { max-width: 720px; margin: 0 auto; text-align: center; }
.hero__headline {
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--copper-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero__sub {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 48px;
}

/* --- Form --- */
.audit-form { max-width: 640px; margin: 0 auto; }
.audit-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .audit-form__row { grid-template-columns: 1fr; }
}
.audit-form__field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.audit-form__field--submit { justify-content: flex-end; }
.audit-form__label {
  font-family: var(--font-data);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.audit-form__input {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  -webkit-appearance: none;
}
.audit-form__input::placeholder { color: var(--text-tertiary); }
.audit-form__input:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(224,120,50,.15);
}
.audit-form__input.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(224,82,82,.15);
}
.audit-form__select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2388889A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}
.audit-form__select option { background: var(--bg-elevated); color: var(--text-primary); }
.audit-form__error {
  font-size: 0.8125rem;
  color: var(--red);
  display: none;
}
.audit-form__error.visible { display: block; }
.audit-form__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--copper) 0%, var(--copper-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 28px;
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  white-space: nowrap;
  width: 100%;
}
.audit-form__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(224,120,50,.35);
}
.audit-form__btn:active { transform: translateY(0); }
.audit-form__btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.audit-form__btn-icon { flex-shrink: 0; }

/* --- Progress Section --- */
.progress-section { padding: 80px 24px 60px; }
.progress-section__inner { max-width: 560px; margin: 0 auto; text-align: center; }
.progress-section__title {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.progress-section__url {
  font-family: var(--font-data);
  font-size: 0.875rem;
  color: var(--copper);
  margin-bottom: 40px;
  word-break: break-all;
}

/* Progress Bar */
.progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 40px;
}
.progress-bar__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--copper-dark), var(--copper), var(--copper-light));
  border-radius: 3px;
  transition: width 0.6s ease-out;
}

/* Steps */
.steps {
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.steps__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  opacity: .4;
  transition: opacity var(--transition), border-color var(--transition), background var(--transition);
}
.steps__item.active {
  opacity: 1;
  border-color: var(--copper);
  background: var(--bg-elevated);
}
.steps__item.done {
  opacity: .7;
  border-color: var(--green);
}
.steps__icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}
.steps__item.active .steps__icon {
  border-color: var(--copper);
}
.steps__item.active .steps__icon::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--copper);
  animation: pulse 1.2s infinite;
}
.steps__item.done .steps__icon {
  border-color: var(--green);
  background: var(--green);
}
.steps__item.done .steps__icon::after {
  content: '';
  width: 10px;
  height: 8px;
  background: url("data:image/svg+xml,%3Csvg width='10' height='8' viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 4L3.5 6.5L9 1' stroke='%2309090B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
  animation: none;
}
.steps__label {
  font-size: 0.9375rem;
  font-weight: 500;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.7); }
}

/* --- Results Section --- */
.results { padding: 60px 24px 80px; }
.results__inner { max-width: 800px; margin: 0 auto; }

/* Score Hero */
.results__hero {
  text-align: center;
  margin-bottom: 48px;
}
.score-gauge {
  width: 180px;
  height: 180px;
  margin: 0 auto 24px;
  position: relative;
}
.score-gauge__svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.score-gauge__track {
  fill: none;
  stroke: var(--bg-elevated);
  stroke-width: 10;
}
.score-gauge__fill {
  fill: none;
  stroke: var(--copper);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 534.07;
  stroke-dashoffset: 534.07;
  transition: stroke-dashoffset 1.5s cubic-bezier(.4,0,.2,1), stroke 0.5s;
}
.score-gauge__value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.score-gauge__number {
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: 3rem;
  line-height: 1;
  display: block;
}
.score-gauge__max {
  font-family: var(--font-data);
  font-size: 0.875rem;
  color: var(--text-tertiary);
}
.results__grade {
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: 1.5rem;
  display: inline-block;
  padding: 6px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.results__url {
  font-family: var(--font-data);
  font-size: 1rem;
  color: var(--copper);
  word-break: break-all;
  margin-bottom: 8px;
}
.results__summary {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

/* Category Cards */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}
.category-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color var(--transition);
}
.category-card:hover { border-color: var(--copper); }
.category-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.category-card__name {
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 0.9375rem;
}
.category-card__score {
  font-family: var(--font-data);
  font-weight: 600;
  font-size: 1.125rem;
}
.category-card__bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}
.category-card__bar-fill {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 1s ease-out;
}
.category-card__detail {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Color coding for scores */
.score-red { color: var(--red); }
.score-yellow { color: var(--yellow); }
.score-green { color: var(--green); }
.bar-red { background: var(--red); }
.bar-yellow { background: var(--yellow); }
.bar-green { background: var(--green); }
.gauge-red { stroke: var(--red); }
.gauge-yellow { stroke: var(--yellow); }
.gauge-green { stroke: var(--green); }
.grade-red { color: var(--red); border-color: rgba(224,82,82,.3); }
.grade-yellow { color: var(--yellow); border-color: rgba(224,184,82,.3); }
.grade-green { color: var(--green); border-color: rgba(82,192,122,.3); }

/* Screenshot */
.screenshot { margin-bottom: 48px; }
.screenshot__title {
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 16px;
}
.screenshot__frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
}
.screenshot__img {
  width: 100%;
  display: block;
}

/* Recommendations */
.recommendations { margin-bottom: 48px; }
.recommendations__title {
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 16px;
}
.recommendations__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.recommendations__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.recommendations__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}
.recommendations__icon--high { background: rgba(224,82,82,.15); color: var(--red); }
.recommendations__icon--medium { background: rgba(224,184,82,.15); color: var(--yellow); }
.recommendations__icon--low { background: rgba(82,192,122,.15); color: var(--green); }
.recommendations__text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.recommendations__text strong {
  color: var(--text-primary);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

/* CTA */
.cta {
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  margin-bottom: 32px;
}
.cta__headline {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.cta__sub {
  color: var(--text-secondary);
  margin-bottom: 28px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}
.cta__buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.cta__btn:hover { transform: translateY(-1px); }
.cta__btn--whatsapp {
  background: #25D366;
  color: #fff;
}
.cta__btn--whatsapp:hover {
  color: #fff;
  box-shadow: 0 4px 16px rgba(37,211,102,.35);
}
.cta__btn--primary {
  background: linear-gradient(135deg, var(--copper) 0%, var(--copper-dark) 100%);
  color: #fff;
}
.cta__btn--primary:hover {
  color: #fff;
  box-shadow: 0 4px 16px rgba(224,120,50,.35);
}

/* Again button */
.results__again {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  transition: border-color var(--transition), color var(--transition);
}
.results__again:hover {
  border-color: var(--copper);
  color: var(--copper);
}

/* --- Error Section --- */
.error-section { padding: 80px 24px 60px; }
.error-section__inner {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}
.error-section__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(224,82,82,.15);
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: 2rem;
  margin: 0 auto 24px;
}
.error-section__title {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.error-section__message {
  color: var(--text-secondary);
  margin-bottom: 32px;
}
.error-section__btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 28px;
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-headline);
  font-weight: 600;
  transition: border-color var(--transition);
}
.error-section__btn:hover { border-color: var(--copper); }

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
}
.footer__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}
.footer__link { font-weight: 500; }

/* --- Utilities & Animations --- */
.fade-in {
  animation: fadeIn 0.5s ease-out both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Responsive tweaks */
@media (max-width: 600px) {
  .hero { padding: 48px 20px 40px; }
  .hero__sub { font-size: 1rem; }
  .progress-section { padding: 48px 20px 40px; }
  .results { padding: 40px 20px 60px; }
  .cta { padding: 32px 20px; }
  .cta__buttons { flex-direction: column; align-items: stretch; }
  .score-gauge { width: 150px; height: 150px; }
  .score-gauge__number { font-size: 2.5rem; }
  .categories { grid-template-columns: 1fr; }
}
