/* Redação Nota Mil - Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --blue: #1a237e;
  --blue-light: #283593;
  --blue-dark: #0d1257;
  --gold: #ffd700;
  --gold-dark: #c9a800;
  --white: #ffffff;
  --gray-50: #f8f9fa;
  --gray-100: #f1f3f5;
  --gray-200: #e9ecef;
  --gray-400: #adb5bd;
  --gray-600: #6c757d;
  --gray-800: #343a40;
  --green: #059669;
  --yellow: #d97706;
  --orange: #ea580c;
  --red: #dc2626;
  --radius: 12px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue), var(--blue-light));
  color: white;
  text-align: center;
  padding: 80px 20px 60px;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,215,0,0.2);
  color: var(--gold);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  border: 1px solid rgba(255,215,0,0.3);
}

.hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}

.gold { color: var(--gold); }

.hero-sub {
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto 30px;
  opacity: 0.9;
  line-height: 1.5;
}

.hero-hint {
  font-size: 13px;
  opacity: 0.6;
  margin-top: 12px;
}

/* CTA Button */
.btn-cta {
  display: inline-block;
  background: var(--gold);
  color: var(--blue-dark);
  padding: 16px 36px;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(255,215,0,0.3);
}

.btn-cta:hover {
  background: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255,215,0,0.4);
}

.btn-cta:disabled {
  background: var(--gray-400);
  color: var(--gray-600);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-cta.full { width: 100%; text-align: center; }

/* Sections */
.section { padding: 40px 0; }

.how-it-works {
  background: white;
  padding: 60px 20px;
  text-align: center;
}

.how-it-works h2, .competencias h2, .pricing h2 {
  font-size: 28px;
  color: var(--blue);
  margin-bottom: 10px;
}

.section-sub {
  color: var(--gray-600);
  margin-bottom: 30px;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.step {
  padding: 24px;
}

.step-number {
  width: 48px;
  height: 48px;
  background: var(--blue);
  color: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  margin: 0 auto 14px;
}

.step h3 {
  font-size: 18px;
  color: var(--blue);
  margin-bottom: 8px;
}

.step p {
  font-size: 14px;
  color: var(--gray-600);
}

/* Competências */
.competencias {
  padding: 60px 20px;
  text-align: center;
}

.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.comp-card {
  background: white;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  text-align: left;
  transition: transform 0.2s;
}

.comp-card:hover { transform: translateY(-3px); }

.comp-num {
  display: inline-block;
  background: var(--blue);
  color: var(--gold);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  text-align: center;
  line-height: 36px;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 10px;
}

.comp-card h3 {
  font-size: 15px;
  color: var(--blue);
  margin-bottom: 6px;
}

.comp-card p {
  font-size: 13px;
  color: var(--gray-600);
}

/* Pricing */
.pricing {
  background: var(--blue-dark);
  padding: 60px 20px;
  text-align: center;
}

.pricing h2 { color: white; }

.price-card {
  background: white;
  max-width: 400px;
  margin: 30px auto 0;
  padding: 40px 30px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.price-tag {
  font-size: 56px;
  font-weight: 800;
  color: var(--blue);
}

.price-tag span { font-size: 28px; }

.price-card h3 {
  color: var(--gray-600);
  font-size: 16px;
  margin-bottom: 20px;
}

.price-card ul {
  list-style: none;
  text-align: left;
  margin-bottom: 24px;
}

.price-card li {
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
  padding-left: 24px;
  position: relative;
}

.price-card li::before {
  content: '\2713';
  color: var(--green);
  font-weight: 700;
  position: absolute;
  left: 0;
}

/* Footer */
footer {
  background: var(--blue-dark);
  color: rgba(255,255,255,0.5);
  padding: 20px;
  text-align: center;
  font-size: 13px;
}

/* App Header */
.app-header {
  background: var(--blue);
  padding: 14px 0;
}

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

.logo {
  color: var(--gold);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 13px;
}

.credits-badge {
  background: var(--gold);
  color: var(--blue-dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.btn-outline-sm {
  background: none;
  border: 1.5px solid rgba(255,255,255,0.4);
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-outline-sm:hover {
  background: rgba(255,255,255,0.1);
  border-color: white;
}

/* Cards */
.card {
  background: white;
  padding: 28px;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}

.card h2 {
  font-size: 22px;
  color: var(--blue);
  margin-bottom: 8px;
}

.card h3 {
  font-size: 18px;
  color: var(--blue);
  margin-bottom: 12px;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 6px;
}

input[type="text"], input[type="email"], input[type="url"], textarea, select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: white;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,35,126,0.1);
}

.input-lg {
  padding: 16px;
  font-size: 16px;
}

textarea { resize: vertical; }

.char-count {
  text-align: right;
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* Input Tabs */
.input-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--gray-200);
}

.input-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-400);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.input-tab.active {
  color: var(--blue);
  border-bottom-color: var(--blue);
}

.input-panel { display: none; }
.input-panel.active { display: block; }

/* Upload */
.upload-area {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.upload-area:hover {
  border-color: var(--blue);
  background: rgba(26,35,126,0.02);
}

.upload-area input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-area p { color: var(--gray-600); font-size: 14px; }
.upload-area .hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

.photo-preview {
  margin-top: 12px;
  text-align: center;
}

.photo-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}

.btn-sm-danger {
  margin-top: 8px;
  background: var(--red);
  color: white;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}

.btn-secondary {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: var(--blue-light);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover { background: var(--blue); }

/* Credits Bar */
.credits-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 16px 20px;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}

.credits-info {
  font-size: 14px;
}

.credits-info strong {
  color: var(--blue);
  font-size: 18px;
}

.btn-buy {
  background: var(--gold);
  color: var(--blue-dark);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-buy:hover {
  background: var(--gold-dark);
}

/* Alert */
.alert {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}

.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-pending { background: #fef3c7; color: #92400e; }

.hint-danger {
  color: var(--red);
  font-size: 13px;
  margin-top: 8px;
  text-align: center;
}

/* Loading */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,35,126,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.loading-content {
  text-align: center;
  color: white;
}

.loading-content h3 { margin: 20px 0 8px; font-size: 20px; }
.loading-content p { opacity: 0.7; font-size: 14px; }

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

/* Result Page */
.score-hero {
  text-align: center;
  padding: 40px 0 30px;
}

.score-gauge {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
}

.gauge-svg {
  transform: rotate(-90deg);
  width: 200px;
  height: 200px;
}

.gauge-bg {
  fill: none;
  stroke: var(--gray-200);
  stroke-width: 12;
}

.gauge-fill {
  fill: none;
  stroke: var(--gold);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 534;
  stroke-dashoffset: 534;
  transition: stroke-dashoffset 1.5s ease-out, stroke 0.5s;
}

.gauge-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-number {
  font-size: 48px;
  font-weight: 800;
  color: var(--blue);
}

.gauge-label {
  font-size: 14px;
  color: var(--gray-400);
}

.score-verdict {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.essay-theme-display {
  font-size: 14px;
  color: var(--gray-600);
  font-style: italic;
}

/* Competency Results */
.comp-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.comp-result-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  border-left: 5px solid var(--gray-200);
}

.comp-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.comp-result-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--blue);
}

.comp-result-score {
  font-size: 22px;
  font-weight: 800;
}

.comp-result-level {
  font-size: 12px;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.comp-result-bar {
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  margin-bottom: 10px;
  overflow: hidden;
}

.comp-result-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease-out;
}

.comp-result-comment {
  font-size: 13px;
  color: var(--gray-600);
  margin-bottom: 8px;
  line-height: 1.5;
}

.comp-errors {
  margin-top: 8px;
}

.comp-error {
  background: #fef2f2;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 12px;
}

.comp-error .erro-trecho {
  color: var(--red);
  text-decoration: line-through;
}

.comp-error .erro-correcao {
  color: var(--green);
  font-weight: 600;
}

.comp-error .erro-tipo {
  color: var(--gray-600);
  font-style: italic;
}

/* Result cards */
.result-card ul {
  list-style: none;
  padding: 0;
}

.result-card li {
  padding: 8px 0;
  padding-left: 20px;
  position: relative;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
}

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

.result-card li::before {
  position: absolute;
  left: 0;
  font-weight: 700;
}

#pontos-fortes-card li::before { content: '\2713'; color: var(--green); }
#melhorias-card li::before { content: '\25B6'; color: var(--orange); }
#dicas-card li::before { content: '\2605'; color: var(--gold-dark); }

.gold-card {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid var(--gold);
}

.texto-corrigido, .texto-original {
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  padding: 16px;
  background: var(--gray-50);
  border-radius: 8px;
}

.texto-original .erro-highlight {
  background: #fecaca;
  padding: 1px 3px;
  border-radius: 3px;
  text-decoration: underline wavy var(--red);
}

.result-footer {
  text-align: center;
  padding: 20px 0 40px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-secondary-lg {
  display: inline-block;
  padding: 16px 36px;
  background: var(--blue);
  color: white;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-secondary-lg:hover { background: var(--blue-light); }

/* History */
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
}

.history-item:hover { background: var(--gray-50); margin: 0 -10px; padding: 12px 10px; border-radius: 6px; }

.history-item .hi-theme {
  font-size: 14px;
  font-weight: 500;
}

.history-item .hi-date {
  font-size: 12px;
  color: var(--gray-400);
}

.history-item .hi-score {
  font-size: 18px;
  font-weight: 800;
  color: var(--blue);
}

/* Score colors */
.score-red { color: var(--red) !important; }
.score-orange { color: var(--orange) !important; }
.score-yellow { color: var(--yellow) !important; }
.score-green { color: var(--green) !important; }
.border-red { border-left-color: var(--red) !important; }
.border-orange { border-left-color: var(--orange) !important; }
.border-yellow { border-left-color: var(--yellow) !important; }
.border-green { border-left-color: var(--green) !important; }
.bar-red { background: var(--red); }
.bar-orange { background: var(--orange); }
.bar-yellow { background: var(--yellow); }
.bar-green { background: var(--green); }

/* Print */
@media print {
  .app-header, .result-footer, .btn-outline-sm { display: none !important; }
  body { background: white; }
  .card, .comp-result-card { box-shadow: none; border: 1px solid #ddd; }
  .score-hero { padding-top: 10px; }
}

/* Mobile */
@media (max-width: 600px) {
  .hero { padding: 50px 16px 40px; }
  .hero h1 { font-size: 26px; }
  .hero-sub { font-size: 15px; }
  .credits-bar { flex-direction: column; gap: 10px; text-align: center; }
  .btn-buy { width: 100%; }
  .comp-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; }
  .card { padding: 20px 16px; }
  .result-footer { flex-direction: column; }
  .result-footer a, .result-footer button { width: 100%; }
}
