/* ── GC Security Scanner ──────────────────────────────────────────────────────────── */

#gcss-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  font-family: inherit;
  min-height: 80vh;
}

/* Keep only the scan form narrow */
#gcss-form.gcss-panel {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* Panels */
.gcss-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 40px;
  margin-bottom: 24px;
}

/* Form */
.gcss-intro {
  margin-bottom: 28px;
}

.gcss-intro h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 8px;
}

.gcss-intro p {
  color: #4a5568;
  margin: 0;
  font-size: 1rem;
}

.gcss-input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#gcss-url {
  flex: 1 1 280px;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid #cbd5e0;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
  color: #2d3748;
}

#gcss-url:focus {
  border-color: #f9bd15;
}

/* ── Questionnaire fields ────────────────────────────────────────────────── */

.gcss-field {
  margin-bottom: 16px;
}

.gcss-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d3748;
}

.gcss-req {
  color: #c53030;
}

.gcss-field input[type="url"],
.gcss-field input[type="text"],
.gcss-field select {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid #cbd5e0;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
  color: #2d3748;
  background-color: #fff;
}

.gcss-field select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%234a5568' 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;
}

.gcss-field input:focus,
.gcss-field select:focus {
  border-color: #f9bd15;
}

.gcss-submit-row {
  margin-top: 4px;
}

/* #gcss-submit shares rules with #gcss-send and #gcss-verify-btn above */

.gcss-error {
  margin: 14px 0 0;
  color: #c53030;
  font-size: 0.9rem;
}

/* ── Progress panel ────────────────────────────────────────────────────────── */

#gcss-progress.gcss-panel {
  background: linear-gradient(150deg, #fffef7 0%, #fffae8 45%, #fff4cc 100%);
  border: 1px solid rgba(249, 189, 21, 0.45);
  box-shadow: 0 4px 24px rgba(249, 189, 21, 0.12);
  text-align: center;
  padding: 44px 40px 40px;
  position: relative;
  overflow: hidden;
}

/* Subtle dot grid */
#gcss-progress.gcss-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(0,0,0,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* Slow scan sweep */
#gcss-progress.gcss-panel::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(249, 189, 21, 0.03) 40%,
    rgba(249, 189, 21, 0.07) 50%,
    rgba(249, 189, 21, 0.03) 60%,
    transparent
  );
  animation: gcss-scan 4s linear infinite;
  pointer-events: none;
}

@keyframes gcss-scan {
  0%   { top: -120px; }
  100% { top: 100%; }
}

/* AI badge */
.gcss-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #1a1a1a;
  border-radius: 100px;
  padding: 6px 16px 6px 10px;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.gcss-ai-badge span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #f9bd15;
}

.gcss-ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f9bd15;
  flex-shrink: 0;
  position: relative;
}

.gcss-ai-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(249, 189, 21, 0.4);
  animation: gcss-dot-pulse 1.4s ease-out infinite;
}

@keyframes gcss-dot-pulse {
  0%   { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Spinner */
.gcss-spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 5px solid rgba(249, 189, 21, 0.2);
  border-top-color: #f9bd15;
  border-right-color: rgba(249, 189, 21, 0.75);
  animation: gcss-spin 0.85s linear infinite;
  margin: 0 auto 20px;
  box-shadow: 0 0 14px rgba(249, 189, 21, 0.8), 0 0 36px rgba(249, 189, 21, 0.35);
  position: relative;
  z-index: 1;
}

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

/* Stage label */
.gcss-stage-label {
  font-size: 1rem;
  font-weight: 600;
  color: #1a202c;
  margin: 0 0 32px;
  position: relative;
  z-index: 1;
}

/* ── Horizontal stepper ───────────────────────────────────────────────────── */

.gcss-stepper {
  display: flex;
  align-items: flex-start;
  width: 100%;
  margin: 0 auto;
  max-width: 720px;
  position: relative;
  z-index: 1;
}

.gcss-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gcss-step__track {
  display: flex;
  align-items: center;
  width: 100%;
}

.gcss-step__line {
  flex: 1;
  height: 2px;
  background: #e2e8f0;
  transition: background 0.5s;
  position: relative;
  overflow: hidden;
}

.gcss-step:first-child .gcss-step__line--l,
.gcss-step:last-child  .gcss-step__line--r {
  visibility: hidden;
}

.gcss-step__circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #94a3b8;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.4s, background 0.4s, box-shadow 0.4s;
  position: relative;
  z-index: 1;
}

.gcss-step__icon { display: none; }

.gcss-step__label {
  margin-top: 10px;
  font-size: 0.65rem;
  color: #475569;
  text-align: center;
  line-height: 1.35;
  letter-spacing: 0.02em;
  transition: color 0.3s;
}

/* Done */
.gcss-step.done .gcss-step__circle {
  background: #059669;
  border-color: #059669;
  box-shadow: 0 0 12px rgba(5, 150, 105, 0.35);
}

.gcss-step.done .gcss-step__icon {
  display: block;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  animation: gcss-check-pop 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

.gcss-step.done .gcss-step__icon::after { content: '✓'; }

@keyframes gcss-check-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.gcss-step.done .gcss-step__line { background: #059669; }
.gcss-step.done .gcss-step__label { color: #059669; font-weight: 600; }

/* Active */
.gcss-step.active .gcss-step__circle {
  border-color: #f9bd15;
  border-width: 2px;
  background: #fff;
  animation: gcss-step-pulse 1.6s ease-out infinite;
}

@keyframes gcss-step-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(249, 189, 21, 0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(249, 189, 21, 0);  }
  100% { box-shadow: 0 0 0 0   rgba(249, 189, 21, 0);   }
}

.gcss-step.active .gcss-step__icon {
  display: block;
  width: 10px;
  height: 10px;
  background: #f9bd15;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(249, 189, 21, 0.7);
}

.gcss-step.active .gcss-step__line--l { background: #059669; }

/* Shimmer on the pending line ahead of active step */
.gcss-step.active .gcss-step__line--r::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(249,189,21,0.6), transparent);
  background-size: 60px 100%;
  animation: gcss-shimmer 1.4s linear infinite;
}

@keyframes gcss-shimmer {
  0%   { background-position: -60px 0; }
  100% { background-position: 200px 0; }
}

.gcss-step.active .gcss-step__label {
  color: #b8860b;
  font-weight: 700;
}

/* Result */
#gcss-result {
  padding: 0;
  border: none;
  overflow: hidden;
}

/* Actions */
#gcss-actions:not([hidden]) {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

.gcss-action-btn {
  display: inline-block;
  padding: 14px 28px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, opacity 0.2s;
  line-height: 1;
  white-space: nowrap;
}

.gcss-action-btn--primary {
  background: #f9bd15;
  color: #1a1a1a;
  border: none;
}

.gcss-action-btn--primary:hover {
  background: #e0a800;
  color: #1a1a1a;
}

.gcss-action-btn--secondary {
  background: transparent;
  color: #1a1a1a;
  border: 2px solid #1a1a1a;
}

.gcss-action-btn--secondary:hover {
  background: #1a1a1a;
  color: #fff;
}

/* Email gate / verify */
#gcss-email,
#gcss-code {
  flex: 1 1 280px;
  padding: 12px 16px !important;
  font-size: 1rem !important;
  border: 2px solid #cbd5e0 !important;
  border-radius: 8px !important;
  outline: none;
  transition: border-color 0.2s;
  color: #2d3748 !important;
  background: #fff !important;
  box-shadow: none !important;
}

#gcss-email:focus,
#gcss-code:focus {
  border-color: #f9bd15 !important;
}

#gcss-send,
#gcss-verify-btn,
#gcss-submit {
  display: inline-block !important;
  padding: 14px 28px !important;
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  background: #f9bd15 !important;
  color: #1a1a1a !important;
  border: none !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  line-height: 1 !important;
  text-decoration: none !important;
  transition: background 0.2s, opacity 0.2s !important;
}

#gcss-send:hover,
#gcss-verify-btn:hover,
#gcss-submit:hover {
  background: #e0a800 !important;
  color: #1a1a1a !important;
}

#gcss-send:disabled,
#gcss-verify-btn:disabled,
#gcss-submit:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.gcss-notice {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.gcss-notice--warn {
  background: #fffbeb;
  border: 1px solid #f6e05e;
  color: #744210;
}

.gcss-resend {
  margin: 16px 0 0;
  color: #718096;
  font-size: 0.9rem;
}

.gcss-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #2563eb;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.gcss-link-btn:hover {
  color: #1d4ed8;
}

/* ── Report ready card ─────────────────────────────────────────────────────── */

.gcss-panel--ready {
  text-align: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.gcss-ready-check {
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
}

.gcss-ready-check svg {
  width: 100%;
  height: 100%;
}

.gcss-ready-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 6px;
}

.gcss-ready-url {
  color: #718096;
  font-size: 0.875rem;
  margin: 0 0 28px;
}

.gcss-ready-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.gcss-ready-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
  white-space: nowrap;
  border: 2px solid transparent;
}

.gcss-ready-btn--primary {
  background: #f9bd15;
  color: #1a1a1a;
  border-color: #f9bd15;
}

.gcss-ready-btn--primary:hover {
  background: #e0a800;
  border-color: #e0a800;
  color: #1a1a1a;
}

.gcss-ready-btn--secondary {
  background: transparent;
  color: #1a1a1a;
  border-color: #1a1a1a;
}

.gcss-ready-btn--secondary:hover {
  background: #1a1a1a;
  color: #fff;
}

.gcss-ready-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 20px;
  color: #a0aec0;
  font-size: 0.82rem;
}

.gcss-ready-divider::before,
.gcss-ready-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.gcss-ready-email-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

#gcss-report-email {
  flex: 1 1 200px;
  padding: 11px 16px;
  font-size: 1rem;
  border: 2px solid #cbd5e0;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
  color: #2d3748;
  background: #fff;
}

#gcss-report-email:focus {
  border-color: #f9bd15;
}

/* Locked to the signed-in email (abuse prevention) — render as read-only, not editable. */
#gcss-report-email[readonly] {
  background: #f4f4f5;
  color: #52525b;
  border-color: #e2e8f0;
  cursor: default;
}

#gcss-report-email[readonly]:focus {
  border-color: #e2e8f0;
}

.gcss-ready-email-note {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: #718096;
  text-align: center;
}

#gcss-send-report {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 11px 20px !important;
  font-size: 0.875rem !important;
  font-weight: 700 !important;
  background: #f9bd15 !important;
  color: #1a1a1a !important;
  border: 2px solid #f9bd15 !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: background 0.2s !important;
}

#gcss-send-report:hover {
  background: #e0a800 !important;
  border-color: #e0a800 !important;
}

#gcss-send-report:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

.gcss-email-status {
  font-size: 0.875rem;
  margin: 0 0 12px;
}

.gcss-email-status--ok {
  color: #059669;
}

.gcss-email-status--error {
  color: #c53030;
}

.gcss-ready-back {
  background: none;
  border: none;
  color: #718096;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0;
  margin-top: 4px;
  text-decoration: underline;
}

.gcss-ready-back:hover {
  color: #4a5568;
}

/* Responsive */
@media (max-width: 520px) {
  .gcss-panel {
    padding: 24px 18px;
  }

  .gcss-input-row {
    flex-direction: column;
  }

  #gcss-submit,
  #gcss-send,
  #gcss-verify-btn {
    width: 100%;
  }

  #gcss-actions:not([hidden]) {
    flex-direction: column;
    align-items: stretch;
  }

  .gcss-action-btn {
    text-align: center;
  }

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

  .gcss-ready-btn {
    justify-content: center;
  }

  .gcss-ready-email-row {
    flex-direction: column;
  }

  #gcss-send-report {
    width: 100% !important;
    justify-content: center !important;
  }
}
