/* ==========================================================================
   Sanitica – Learn / Education Hub
   ========================================================================== */

/* -- Edu hero ------------------------------------------------------------- */

.edu-page { padding-top: 100px; min-height: 100vh; }

.edu-hero { text-align: center; padding: 40px 0 64px; }
.edu-hero h1 { font-size: 42px; font-weight: 700; letter-spacing: -1px; margin-bottom: 16px; }
.edu-hero h1 .gradient { background: linear-gradient(135deg, var(--teal), var(--blue)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.edu-hero p { font-size: 18px; color: var(--text-secondary); max-width: 600px; margin: 0 auto; line-height: 1.75; }

/* -- Hub card grid -------------------------------------------------------- */

.edu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 80px; }

.edu-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 36px 32px; transition: all 0.4s ease; position: relative; overflow: hidden;
  text-decoration: none; color: inherit; display: block;
}
.edu-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--blue)); opacity: 0;
  transition: opacity 0.4s;
}
.edu-card:hover {
  border-color: var(--border-light); transform: translateY(-4px);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
}
.edu-card:hover::before { opacity: 0.8; }
.edu-card:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.edu-card-icon {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--teal-faint); border: 1px solid rgba(0, 240, 212, 0.15);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; font-size: 24px;
}

.edu-card h3 { font-size: 19px; font-weight: 600; margin-bottom: 10px; }
.edu-card p { font-size: 14.5px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }
.edu-card-link {
  font-family: var(--font-mono); font-size: 12px; color: var(--teal);
  letter-spacing: 0.5px; transition: letter-spacing 0.3s;
}
.edu-card:hover .edu-card-link { letter-spacing: 1.5px; }

/* -- Edu section (shared for inner pages) --------------------------------- */

.edu-section { padding: 0 0 80px; }
.edu-section h2 { font-size: 28px; font-weight: 700; margin-bottom: 16px; }
.edu-section p.lead { font-size: 16px; color: var(--text-secondary); max-width: 600px; line-height: 1.75; margin-bottom: 40px; }

/* -- Back link ------------------------------------------------------------ */

.edu-back {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 32px;
  font-size: 13px; color: var(--text-muted); text-decoration: none;
  font-family: var(--font-mono); letter-spacing: 0.5px; transition: color 0.3s;
}
.edu-back:hover { color: var(--teal); }

/* -- Document Journey ----------------------------------------------------- */

.journey-diagram { position: relative; margin: 48px 0; }

.journey-steps {
  display: flex; align-items: flex-start; gap: 0; justify-content: center; position: relative;
}

.journey-step {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  cursor: pointer; padding: 16px; border-radius: 16px; transition: all 0.3s;
  position: relative; flex: 0 0 160px; text-align: center;
}
.journey-step:hover { background: var(--bg-surface); }
.journey-step.active { background: var(--bg-surface); border: 1px solid var(--border); }

.journey-step-icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; border: 1px solid var(--border); transition: all 0.3s;
}
.journey-step-icon.safe { background: var(--teal-faint); border-color: rgba(0, 240, 212, 0.2); }
.journey-step-icon.danger { background: rgba(232, 54, 79, 0.08); border-color: rgba(232, 54, 79, 0.2); }
.journey-step-icon.neutral { background: var(--bg-elevated); }

.journey-step-label { font-size: 13px; font-weight: 500; color: var(--text-primary); line-height: 1.4; }

.journey-arrow {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 18px; padding-top: 20px; flex-shrink: 0;
}

.journey-explanation {
  display: none; margin-top: 24px; padding: 24px;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: 14px;
}
.journey-explanation.visible { display: block; animation: quizFadeIn 0.4s ease; }
.journey-explanation h4 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.journey-explanation p { font-size: 14.5px; color: var(--text-secondary); line-height: 1.7; }

/* Branch */
.journey-branch { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 32px; }
.journey-branch-path {
  flex: 1; padding: 24px; border-radius: 14px; border: 1px solid var(--border);
  text-align: center; transition: all 0.3s;
}
.journey-branch-path.danger { border-color: rgba(232, 54, 79, 0.2); background: rgba(232, 54, 79, 0.03); }
.journey-branch-path.safe { border-color: rgba(0, 240, 212, 0.15); background: var(--teal-faint); }
.journey-branch-path h4 { font-size: 15px; font-weight: 600; margin: 12px 0 8px; }
.journey-branch-path.danger h4 { color: var(--red); }
.journey-branch-path.safe h4 { color: var(--teal); }
.journey-branch-path p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.journey-branch-icon { font-size: 32px; }

/* -- Risk Calculator ------------------------------------------------------ */

.calc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 40px; }

.calc-input-group { display: flex; flex-direction: column; gap: 8px; }
.calc-input-group label {
  font-size: 14px; font-weight: 500; color: var(--text-primary);
}
.calc-input-group input[type="number"] {
  padding: 14px 18px; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text-primary); font-family: var(--font-mono);
  font-size: 16px; outline: none; transition: all 0.3s; width: 100%;
}
.calc-input-group input[type="number"]:focus {
  border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-faint);
}
.calc-input-group select {
  padding: 14px 18px; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text-primary); font-family: var(--font-mono);
  font-size: 14px; outline: none; transition: all 0.3s; width: 100%;
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.calc-input-group select:focus {
  border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-faint);
}
.calc-input-group select option {
  background: var(--bg-deep); color: var(--text-primary);
}

.calc-data-types { grid-column: 1 / -1; }
.calc-data-types label.group-label { font-size: 14px; font-weight: 500; color: var(--text-primary); margin-bottom: 12px; display: block; }
.calc-checkboxes { display: flex; flex-wrap: wrap; gap: 10px; }

.calc-checkbox {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; transition: all 0.3s; font-size: 14px; color: var(--text-secondary);
}
.calc-checkbox:hover { border-color: var(--border-light); }
.calc-checkbox.checked { border-color: var(--teal); background: var(--teal-faint); color: var(--text-primary); }
.calc-checkbox input { display: none; }

.calc-submit {
  grid-column: 1 / -1; display: flex; justify-content: center;
}

.calc-result {
  display: none; padding: 40px; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 16px; text-align: center; margin-bottom: 48px;
}
.calc-result.visible { display: block; animation: quizFadeIn 0.5s ease; }
.calc-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 24px; }
.calc-result-item h3 {
  font-size: 40px; font-weight: 700; line-height: 1.2; margin-bottom: 4px;
}
.calc-result-item h3.danger { color: var(--red); }
.calc-result-item h3.warning { color: #F97316; }
.calc-result-item p { font-size: 14px; color: var(--text-secondary); }
.calc-result-note { font-size: 13px; color: var(--text-muted); font-style: italic; margin-top: 16px; }

/* -- Hidden PII ----------------------------------------------------------- */

.pii-document-wrap { position: relative; max-width: 600px; margin: 0 auto 48px; }

.pii-document {
  background: #1a2236; border: 1px solid var(--border); border-radius: 14px;
  padding: 32px; font-family: var(--font-mono); font-size: 13px; line-height: 2;
  color: var(--text-secondary); position: relative;
}
.pii-document-header {
  border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 20px;
  font-size: 11px; color: var(--text-muted);
}

.pii-zone {
  display: inline; padding: 2px 6px; border-radius: 4px;
  border: 1px dashed rgba(232, 54, 79, 0.3); cursor: pointer;
  transition: all 0.3s; position: relative; background: rgba(232, 54, 79, 0.05);
}
.pii-zone:hover {
  border-color: var(--red); background: rgba(232, 54, 79, 0.12);
  box-shadow: 0 0 12px rgba(232, 54, 79, 0.15);
}
.pii-zone:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.pii-zone.revealed { border-color: var(--teal); background: var(--teal-faint); }

.pii-popup {
  display: none; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(100% + 12px); z-index: 10; width: 300px;
  padding: 16px 20px; background: var(--bg-elevated); border: 1px solid var(--border-light);
  border-radius: 12px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  font-family: var(--font-display); text-align: left;
}
.pii-popup.visible { display: block; animation: quizFadeIn 0.3s ease; }
.pii-popup::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent; border-top-color: var(--bg-elevated);
}
.pii-popup h4 { font-size: 14px; font-weight: 600; color: var(--red); margin-bottom: 6px; }
.pii-popup p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin: 0; }

.pii-legend {
  display: flex; gap: 24px; justify-content: center; margin-top: 24px;
  font-size: 13px; color: var(--text-muted);
}
.pii-legend-item { display: flex; align-items: center; gap: 8px; }
.pii-legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.pii-legend-dot.danger { background: var(--red); }
.pii-legend-dot.safe { background: var(--teal); }

/* -- GDPR Flip Cards ------------------------------------------------------ */

.gdpr-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 80px; }

.gdpr-card {
  perspective: 1000px; height: 220px; cursor: pointer;
}
.gdpr-card-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.6s ease; transform-style: preserve-3d;
}
.gdpr-card.flipped .gdpr-card-inner { transform: rotateY(180deg); }

.gdpr-card-front, .gdpr-card-back {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: 14px; padding: 28px 24px; border: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.gdpr-card-front {
  background: var(--bg-surface); align-items: center; justify-content: center; text-align: center;
}
.gdpr-card-back {
  background: var(--bg-elevated); transform: rotateY(180deg); justify-content: center;
}

.gdpr-card-front-icon { font-size: 36px; margin-bottom: 14px; }
.gdpr-card-front-label {
  font-family: var(--font-mono); font-size: 10px; color: var(--teal);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 10px;
}
.gdpr-card-front h3 { font-size: 15px; font-weight: 600; line-height: 1.45; }

.gdpr-card-back p { font-size: 14px; color: var(--text-secondary); line-height: 1.65; }
.gdpr-card-back .gdpr-ref {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
  margin-top: 12px; letter-spacing: 0.5px;
}
.gdpr-card-flip-hint {
  font-size: 11px; color: var(--text-muted); margin-top: 8px;
  font-family: var(--font-mono); letter-spacing: 0.5px;
}

/* -- CTA bar (reused on edu pages) ---------------------------------------- */

.edu-cta {
  padding: 56px 0; border-top: 1px solid var(--border); text-align: center; margin-top: 48px;
}
.edu-cta h3 { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.edu-cta p { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.edu-cta .signup-form { max-width: 440px; margin: 0 auto; }

/* -- Responsive ----------------------------------------------------------- */

@media (max-width: 900px) {
  .edu-hero h1 { font-size: 32px; }
  .edu-grid { grid-template-columns: 1fr; }
  .journey-steps { flex-direction: column; align-items: center; }
  .journey-arrow { transform: rotate(90deg); padding: 8px 0; }
  .journey-branch { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .journey-branch { grid-template-columns: 1fr; }
  .calc-form { grid-template-columns: 1fr; }
  .calc-result-grid { grid-template-columns: 1fr; }
  .gdpr-grid { grid-template-columns: 1fr; }
  .edu-page { padding-top: 80px; }
  .edu-hero h1 { font-size: 26px; }
  .edu-hero p { font-size: 16px; }
  .edu-card { padding: 24px 20px; }
  .journey-step { flex: 0 0 auto; }
  .pii-document { padding: 20px; font-size: 12px; }
  .pii-popup { width: 250px; }
  .gdpr-card { height: 240px; }
}

/* -- Legal pages (Privacy / Terms) ---------------------------------------- */

.edu-page.legal .edu-hero {
  padding: 16px 0 32px;
}

.legal-content {
  max-width: 720px;
  margin: 0 auto 80px;
}

.legal-content h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 40px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.legal-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.legal-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 8px;
}

.legal-content p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.legal-content ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.legal-content ul li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 6px;
}
.legal-content ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

.legal-content a {
  color: var(--teal);
  text-decoration: none;
  transition: opacity 0.3s;
}
.legal-content a:hover {
  opacity: 0.8;
}

.legal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 16px 0 24px;
  font-size: 14px;
}
.legal-table th,
.legal-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.legal-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--bg-surface);
}
.legal-table td {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Reuse quiz animation */
@keyframes quizFadeIn {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}
