/* ═══════════════════════════════════════════════════════════════
   ProGrade Design System
   Author: ATLAS TECH
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  /* Colors */
  --bg: #fafafa;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;

  /* Accent */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #dbeafe;
  --accent-bg: #eff6ff;

  /* Semantic */
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #eab308;
  --warning-light: #fef9c3;
  --error: #dc2626;
  --error-light: #fee2e2;

  /* Typography */
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --nav-height: 64px;
  --container: 1120px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;

  /* Transitions */
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  display: block;
}

/* ── Container ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Navigation ───────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(250, 250, 250, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

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

.nav-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--text);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-outline:hover {
  background: var(--accent);
  color: #ffffff;
}

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

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

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

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--accent);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.card-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.card-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.card-footer {
  margin-top: 20px;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  padding: calc(var(--nav-height) + 80px) 0 80px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  margin-bottom: 24px;
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
  color: var(--text);
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── Grid ─────────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ── Section ──────────────────────────────────────────────── */
.section {
  padding: 80px 0;
}

.section-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 48px;
}

/* ── Steps ────────────────────────────────────────────────── */
.step-number {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.step-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-desc {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Trust ────────────────────────────────────────────────── */
.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.trust-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  background: var(--success-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.trust-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--success);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trust-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.trust-desc {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  padding: calc(var(--nav-height) + 48px) 0 48px;
  text-align: center;
}

.page-header h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.page-header p {
  font-size: 16px;
  color: var(--text-secondary);
}

/* ── Upload Zone ──────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-bg);
}

.upload-zone-icon {
  width: 56px;
  height: 56px;
  background: var(--accent-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.upload-zone-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.upload-zone-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.upload-zone-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.upload-zone input[type="file"] {
  display: none;
}

/* ── Textarea ─────────────────────────────────────────────── */
.textarea-group {
  margin-top: 16px;
}

.textarea-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.textarea-group textarea {
  width: 100%;
  min-height: 160px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-card);
  resize: vertical;
  transition: border-color var(--transition);
}

.textarea-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.textarea-group textarea::placeholder {
  color: var(--text-muted);
}

/* ── File Preview ─────────────────────────────────────────── */
.file-preview {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--accent-bg);
  border-radius: var(--radius-sm);
  margin-top: 16px;
}

.file-preview.active {
  display: flex;
}

.file-preview-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
}

.file-preview-name {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

.file-preview-remove {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary);
}

.file-preview-remove svg {
  width: 16px;
  height: 16px;
}

/* ── Separator ────────────────────────────────────────────── */
.separator {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.separator::before,
.separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Loading ──────────────────────────────────────────────── */
.loading {
  display: none;
  text-align: center;
  padding: 48px 24px;
}

.loading.active {
  display: block;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  font-size: 15px;
  color: var(--text-secondary);
}

/* ── Results ──────────────────────────────────────────────── */
.results {
  display: none;
}

.results.active {
  display: block;
}

.score-section {
  text-align: center;
  padding: 40px 0;
}

.score-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--score) * 1%), var(--border-light) 0);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  position: relative;
}

.score-circle-inner {
  width: 130px;
  height: 130px;
  background: var(--bg-card);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-value {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.score-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.grade-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.grade-A { background: var(--success); }
.grade-B { background: #22c55e; }
.grade-C { background: var(--warning); }
.grade-D { background: #f97316; }
.grade-F { background: var(--error); }

.score-summary {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ── Category Bars ────────────────────────────────────────── */
.categories {
  padding: 32px 0;
}

.category-item {
  margin-bottom: 20px;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.category-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.category-score {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.category-bar {
  width: 100%;
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.6s ease;
}

.category-feedback {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.5;
}

/* ── Strengths & Improvements ─────────────────────────────── */
.feedback-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 32px 0;
}

.feedback-list h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-list h3 svg {
  width: 20px;
  height: 20px;
}

.feedback-list.strengths h3 {
  color: var(--success);
}

.feedback-list.strengths h3 svg {
  stroke: var(--success);
  fill: none;
  stroke-width: 2;
}

.feedback-list.improvements h3 {
  color: #f97316;
}

.feedback-list.improvements h3 svg {
  stroke: #f97316;
  fill: none;
  stroke-width: 2;
}

.feedback-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

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

.feedback-item-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 1px;
}

.strengths .feedback-item-icon {
  color: var(--success);
}

.improvements .feedback-item-icon {
  color: #f97316;
}

/* ── Result Actions ───────────────────────────────────────── */
.result-actions {
  text-align: center;
  padding: 32px 0;
}

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  margin-top: auto;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-text {
  font-size: 13px;
  color: var(--text-muted);
}

.footer-text a {
  color: var(--text-secondary);
  font-weight: 500;
}

.footer-text a:hover {
  color: var(--accent);
}

/* ── CTA Section ──────────────────────────────────────────── */
.cta-section {
  text-align: center;
  padding: 64px 0;
  background: var(--accent-bg);
  border-radius: var(--radius);
  margin: 0 24px 80px;
}

.cta-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.cta-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 48px 0;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-title {
    font-size: 40px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(250, 250, 250, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 16px 24px 24px;
    gap: 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    padding: calc(var(--nav-height) + 48px) 0 48px;
  }

  .hero-title {
    font-size: 32px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 48px 0;
  }

  .section-title {
    font-size: 24px;
  }

  .page-header h1 {
    font-size: 28px;
  }

  .feedback-lists {
    grid-template-columns: 1fr;
  }

  .cta-section {
    margin: 0 16px 48px;
    padding: 40px 24px;
  }

  .cta-title {
    font-size: 22px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .score-circle {
    width: 130px;
    height: 130px;
  }

  .score-circle-inner {
    width: 105px;
    height: 105px;
  }

  .score-value {
    font-size: 36px;
  }
}
