/* ============================================================
   151 Digital — SEO Audit Tool — style.css
   ============================================================ */

/* ---------- Reset & Base ----------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-primary:    #1a1a2e;
  --color-accent:     #4299e1;
  --color-success:    #48bb78;
  --color-error:      #fc8181;
  --color-bg:         #f7fafc;
  --color-card:       #ffffff;
  --color-text:       #2d3748;
  --color-muted:      #718096;
  --color-border:     #e2e8f0;
  --radius:           8px;
  --shadow:           0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --font-sans:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                      Helvetica, Arial, sans-serif;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---------- Layout ----------------------------------------- */
.section {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ---------- Header ----------------------------------------- */
.site-header {
  background: var(--color-primary);
  color: #fff;
  padding: 28px 24px;
}

.header-inner {
  max-width: 640px;
  margin: 0 auto;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.site-tagline {
  margin-top: 4px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
}

/* ---------- Card ------------------------------------------- */
main.card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  max-width: 640px;
  width: calc(100% - 32px);
  margin: 24px auto 40px;
  padding: 32px 28px;
}

/* ---------- Form fields ------------------------------------ */
.field-group {
  margin-bottom: 22px;
}

.field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.required {
  color: var(--color-error);
  margin-left: 2px;
}

.optional {
  color: var(--color-muted);
  font-weight: 400;
  font-size: 0.8rem;
  margin-left: 4px;
}

.field-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.field-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

select.field-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23718096' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.field-hint {
  margin-top: 5px;
  font-size: 0.8rem;
  color: var(--color-muted);
}

/* ---------- File drop zone --------------------------------- */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--color-accent);
  background: rgba(66, 153, 225, 0.05);
}

.drop-zone:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

.drop-zone-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.drop-zone-text {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.drop-zone.has-file .drop-zone-text {
  color: var(--color-text);
  font-weight: 600;
}

/* Hide the native file input */
.drop-zone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Buttons ---------------------------------------- */
.btn-primary {
  display: block;
  width: 100%;
  padding: 13px 20px;
  background: var(--color-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  margin-top: 8px;
}

.btn-primary:hover {
  background: #16213e;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-block;
  margin-top: 24px;
  padding: 10px 18px;
  background: transparent;
  color: var(--color-accent);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: rgba(66, 153, 225, 0.08);
}

/* ---------- Banners ---------------------------------------- */
.error-banner {
  background: rgba(252, 129, 129, 0.12);
  border: 1px solid var(--color-error);
  border-radius: var(--radius);
  color: #c53030;
  font-size: 0.875rem;
  padding: 12px 14px;
  margin-bottom: 20px;
}

.success-banner {
  background: rgba(72, 187, 120, 0.12);
  border: 1px solid var(--color-success);
  border-radius: var(--radius);
  color: #276749;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 12px 14px;
  margin-bottom: 24px;
}

/* ---------- Progress heading ------------------------------- */
.progress-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 24px;
}

/* ---------- Step list -------------------------------------- */
.step-list {
  list-style: none;
  margin-bottom: 28px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.step-item:last-child {
  border-bottom: none;
}

.step-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border-radius: 50%;
}

.step-icon.pending {
  color: var(--color-muted);
}

.step-icon.active {
  color: var(--color-accent);
  animation: spin 1s linear infinite;
  display: inline-block;
}

.step-icon.done {
  color: var(--color-success);
}

.step-label {
  font-size: 0.9rem;
  color: var(--color-text);
}

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

.progress-subtext {
  font-size: 0.825rem;
  color: var(--color-muted);
  text-align: center;
  margin-top: 4px;
}

/* ---------- Results section -------------------------------- */
.success-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.success-heading h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
}

.success-checkmark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--color-success);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------- Result cards ----------------------------------- */
.result-list {
  list-style: none;
  margin-bottom: 8px;
}

.result-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.result-card:last-child {
  border-bottom: none;
}

.result-card-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}

.result-card-body {
  flex: 1;
  min-width: 0;
}

.result-card-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

.result-card-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 2px;
}

.result-card-link {
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 12px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  transition: background 0.15s;
}

.result-card-link:hover {
  background: rgba(66, 153, 225, 0.08);
}

/* ---------- Responsive ------------------------------------- */
@media (max-width: 480px) {
  main.card {
    padding: 24px 18px;
    width: calc(100% - 16px);
    margin: 16px auto 32px;
  }

  .site-header {
    padding: 20px 18px;
  }

  .site-title {
    font-size: 1.1rem;
  }
}
