/* ============================================================================
   AWS Security Assessment Tool - Styles
   ============================================================================ */

/* Variables */
:root {
  --color-critical: #F44336;
  --color-warning: #FF9800;
  --color-good: #2196F3;
  --color-excellent: #4CAF50;
  --color-text: #333;
  --color-text-light: #666;
  --color-border: #e0e0e0;
  --color-bg-light: #f5f5f5;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
}

/* Container */
#assessment-app {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-light);
  font-size: 18px;
}

/* ============================================================================
   Progress Bar
   ============================================================================ */

.progress-bar {
  position: relative;
  width: 100%;
  height: 12px;
  background: var(--color-bg-light);
  border-radius: 6px;
  margin-bottom: 40px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-good), var(--color-excellent));
  border-radius: 6px;
  transition: width 0.4s ease;
}

.progress-text {
  position: absolute;
  top: -25px;
  right: 0;
  font-size: 14px;
  color: var(--color-text-light);
  font-weight: 600;
}

/* ============================================================================
   Question Card
   ============================================================================ */

.question-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 40px;
  box-shadow: var(--shadow-md);
  margin-bottom: 20px;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.question-number {
  color: var(--color-text-light);
  font-size: 14px;
  font-weight: 500;
}

.category-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-iam { background: #E3F2FD; color: #1976D2; }
.category-logging { background: #F3E5F5; color: #7B1FA2; }
.category-network { background: #FFF3E0; color: #F57C00; }
.category-encryption { background: #E8F5E9; color: #388E3C; }
.category-roles { background: #FCE4EC; color: #C2185B; }

.question-text {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-text);
  margin: 20px 0;
  line-height: 1.4;
}

.question-info {
  background: #F5F9FF;
  border-left: 4px solid var(--color-good);
  padding: 12px 16px;
  margin: 20px 0;
  border-radius: 4px;
  color: var(--color-text-light);
  font-size: 15px;
  line-height: 1.6;
}

/* Previous answer indicator */
.previous-answer {
  background: #E3F2FD;
  border-left: 4px solid var(--color-good);
  padding: 12px 16px;
  margin: 15px 0;
  border-radius: 4px;
  font-size: 14px;
  color: var(--color-text);
}

/* ============================================================================
   Answer Buttons
   ============================================================================ */

.answer-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 30px;
}

@media (max-width: 640px) {
  .answer-buttons {
    grid-template-columns: 1fr;
  }
}

.btn-answer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  font-size: 16px;
  font-weight: 600;
  border: 2px solid var(--color-border);
  border-radius: 12px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 100px;
}

.btn-answer:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-icon {
  font-size: 28px;
  line-height: 1;
}

.btn-text {
  font-size: 16px;
}

.btn-yes:hover {
  border-color: var(--color-excellent);
  background: #E8F5E9;
}

.btn-no:hover {
  border-color: var(--color-critical);
  background: #FFEBEE;
}

.btn-unsure:hover {
  border-color: var(--color-warning);
  background: #FFF3E0;
}

/* Selected answer button state */
.btn-answer.selected {
  border-width: 3px;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

.btn-yes.selected {
  border-color: var(--color-excellent);
  background: #E8F5E9;
}

.btn-no.selected {
  border-color: var(--color-critical);
  background: #FFEBEE;
}

.btn-unsure.selected {
  border-color: var(--color-warning);
  background: #FFF3E0;
}

.btn-back {
  margin-top: 20px;
  padding: 12px 24px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-light);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back:hover {
  background: var(--color-bg-light);
}

/* ============================================================================
   Email Capture
   ============================================================================ */

.email-capture {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 50px 40px;
  box-shadow: var(--shadow-md);
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.capture-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

.email-capture h2 {
  font-size: 32px;
  margin-bottom: 10px;
  color: var(--color-text);
}

.capture-subtitle {
  font-size: 16px;
  color: var(--color-text-light);
  margin-bottom: 30px;
}

.email-form {
  max-width: 400px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 2px solid var(--color-border);
  border-radius: 8px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-good);
}

.btn-submit {
  width: 100%;
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 600;
  background: #2bbdee;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
}

.btn-submit:hover {
  background: #1a9dc7;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(43, 189, 238, 0.3);
}

.btn-submit:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.privacy-note {
  font-size: 13px;
  color: var(--color-text-light);
  margin-top: 20px;
  line-height: 1.5;
}

.privacy-note a {
  color: var(--color-good);
  text-decoration: none;
}

/* ============================================================================
   Turnstile (added)
   ============================================================================ */

.turnstile-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 0 0;
}

.turnstile-error {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--color-critical);
  text-align: center;
}

/* Ensure the widget doesn't overflow on small screens */
@media (max-width: 420px) {
  .turnstile-wrap {
    justify-content: flex-start;
  }
  #turnstile-container {
    transform: scale(0.92);
    transform-origin: left top;
  }
}

/* ============================================================================
   Results Display
   ============================================================================ */

.results-container {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.results-header {
  text-align: center;
  padding: 40px 20px;
  background: white;
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
}

.results-header h2 {
  font-size: 32px;
  margin-bottom: 30px;
  color: var(--color-text);
}

/* Score Circle */
.score-circle {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 20px;
}

.score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: var(--color-bg-light);
  stroke-width: 12;
}

.score-ring-fill {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 565;
  stroke-dashoffset: 565;
  transition: stroke-dashoffset 1s ease;
}

.critical .score-ring-fill { stroke: var(--color-critical); }
.warning .score-ring-fill { stroke: var(--color-warning); }
.good .score-ring-fill { stroke: var(--color-good); }
.excellent .score-ring-fill { stroke: var(--color-excellent); }

.score-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-number {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
}

.critical .score-number { color: var(--color-critical); }
.warning .score-number { color: var(--color-warning); }
.good .score-number { color: var(--color-good); }
.excellent .score-number { color: var(--color-excellent); }

.score-label {
  font-size: 14px;
  color: var(--color-text-light);
  margin-top: 5px;
}

.risk-badge {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 600;
  margin: 10px 0;
}

.risk-badge.critical { background: #FFEBEE; color: var(--color-critical); }
.risk-badge.warning { background: #FFF3E0; color: var(--color-warning); }
.risk-badge.good { background: #E3F2FD; color: var(--color-good); }
.risk-badge.excellent { background: #E8F5E9; color: var(--color-excellent); }

.score-summary {
  font-size: 16px;
  color: var(--color-text-light);
  margin-top: 15px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: white;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.stat-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-excellent);
  margin-bottom: 8px;
}

.stat-number.stat-warning {
  color: var(--color-critical);
}

.stat-label {
  font-size: 14px;
  color: var(--color-text-light);
  font-weight: 500;
}

/* Category Breakdown */
.category-breakdown {
  background: white;
  padding: 40px;
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}

.category-breakdown h3 {
  font-size: 24px;
  margin-bottom: 25px;
  color: var(--color-text);
}

.category-grid {
  display: grid;
  gap: 20px;
}

.category-card {
  padding: 20px;
  background: var(--color-bg-light);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.category-header h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.category-score {
  font-size: 20px;
  font-weight: 700;
}

.category-score.critical { color: var(--color-critical); }
.category-score.warning { color: var(--color-warning); }
.category-score.good { color: var(--color-excellent); }

.category-bar-container {
  margin-bottom: 8px;
}

.category-bar {
  height: 8px;
  background: white;
  border-radius: 4px;
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.category-bar-fill.critical { background: var(--color-critical); }
.category-bar-fill.warning { background: var(--color-warning); }
.category-bar-fill.good { background: var(--color-excellent); }

.category-detail {
  font-size: 13px;
  color: var(--color-text-light);
  margin: 0;
}

/* Top Fixes */
.top-fixes {
  background: white;
  padding: 40px;
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}

.top-fixes h3 {
  font-size: 24px;
  margin-bottom: 10px;
  color: var(--color-text);
}

.section-subtitle {
  color: var(--color-text-light);
  margin-bottom: 25px;
}

.fixes-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.fix-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--color-bg-light);
  border-radius: 8px;
  border-left: 4px solid var(--color-critical);
}

.fix-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--color-critical);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.fix-content h4 {
  font-size: 16px;
  margin: 0 0 8px 0;
  color: var(--color-text);
}

.fix-info {
  font-size: 14px;
  color: var(--color-text-light);
  margin: 8px 0;
  line-height: 1.5;
}

.fix-priority {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  background: #FFEBEE;
  color: var(--color-critical);
  border-radius: 12px;
  margin-top: 8px;
}

.no-fixes {
  text-align: center;
  padding: 40px;
  color: var(--color-text-light);
  font-size: 18px;
}

/* CTA Section */
.cta-section {
  background: white;
  padding: 50px 40px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}

.cta-section.critical { border-top: 4px solid var(--color-critical); }
.cta-section.warning { border-top: 4px solid var(--color-warning); }
.cta-section.good { border-top: 4px solid var(--color-good); }
.cta-section.excellent { border-top: 4px solid var(--color-excellent); }

.cta-content h3 {
  font-size: 26px;
  margin-bottom: 15px;
  color: var(--color-text);
}

.cta-content p {
  font-size: 16px;
  color: var(--color-text-light);
  margin-bottom: 25px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-button {
  display: inline-block;
  padding: 16px 40px;
  font-size: 18px;
  font-weight: 600;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  margin-bottom: 15px;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.cta-button.critical { background: var(--color-critical); }
.cta-button.warning { background: var(--color-warning); }
.cta-button.good { background: var(--color-good); }
.cta-button.excellent { background: var(--color-excellent); }

.cta-note {
  font-size: 13px;
  color: var(--color-text-light);
  margin-top: 15px;
}

/* Next Steps */
.next-steps {
  background: #F5F9FF;
  border: 2px solid #E3F2FD;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
}

.next-steps-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.next-steps h4 {
  font-size: 22px;
  margin-bottom: 15px;
  color: var(--color-text);
}

.next-steps p {
  color: var(--color-text-light);
  margin-bottom: 15px;
  line-height: 1.6;
}

.next-steps ul {
  text-align: left;
  max-width: 500px;
  margin: 20px auto;
  padding-left: 20px;
}

.next-steps li {
  margin-bottom: 8px;
  color: var(--color-text-light);
  line-height: 1.5;
}

.email-note {
  font-size: 13px;
  color: var(--color-text-light);
  margin-top: 20px;
}

.email-note a {
  color: var(--color-good);
  text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
  #assessment-app {
    padding: 0 15px;
  }

  .question-card,
  .email-capture,
  .category-breakdown,
  .top-fixes,
  .cta-section {
    padding: 30px 20px;
  }

  .question-text {
    font-size: 20px;
  }

  .results-header h2,
  .cta-content h3 {
    font-size: 24px;
  }

  .score-circle {
    width: 180px;
    height: 180px;
  }

  .score-number {
    font-size: 48px;
  }
}
