/* css/style.css — Shuvà
   Clean institutional design with subtle vintage warmth
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Palette */
  --bg-main: #E6ECEF;
  --bg-secondary: #D3DCE2;
  --text-main: #2E3A40;
  --text-secondary: #5E6F7C;
  --accent-main: #6F889A;
  --accent-secondary: #5F7F7A;
  
  /* Derived */
  --bg-card: rgba(255, 255, 255, 0.45);
  --border-light: rgba(94, 111, 124, 0.12);
  --border-medium: rgba(94, 111, 124, 0.2);
  
  /* Typography */
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  
  /* Layout */
  --content-width: 640px;
  --nav-height: 56px;
}

/* ═══════════════════════════════════════════════════════════════
   Base
   ═══════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-main);
  background: var(--bg-main);
  -webkit-font-smoothing: antialiased;
}

/* Page transition */
body {
  opacity: 0;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  body { opacity: 1; animation: none; }
}

/* ═══════════════════════════════════════════════════════════════
   Background
   ═══════════════════════════════════════════════════════════════ */
.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #EEF2F4 0%, var(--bg-main) 40%, var(--bg-secondary) 100%);
}

/* Subtle paper grain */
.bg__grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ═══════════════════════════════════════════════════════════════
   Fog Effect (index.html hero only)
   ═══════════════════════════════════════════════════════════════ */
.fog {
  position: absolute;
  inset: -60px;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.fog__layer {
  position: absolute;
  inset: -20%;
  filter: blur(60px);
  will-change: transform;
}

.fog__layer--1 {
  background: radial-gradient(ellipse 50% 40% at 30% 50%, rgba(111, 136, 154, 0.18), transparent 70%);
  animation: fog1 20s ease-in-out infinite;
}

.fog__layer--2 {
  background: radial-gradient(ellipse 45% 35% at 70% 45%, rgba(95, 127, 122, 0.14), transparent 70%);
  animation: fog2 26s ease-in-out infinite;
}

.fog__layer--3 {
  background: radial-gradient(ellipse 55% 50% at 50% 55%, rgba(230, 236, 239, 0.2), transparent 60%);
  animation: fog3 22s ease-in-out infinite;
}

@keyframes fog1 {
  0%, 100% { transform: translate(0, 0); opacity: 0.6; }
  50% { transform: translate(4%, -3%); opacity: 0.8; }
}

@keyframes fog2 {
  0%, 100% { transform: translate(0, 0); opacity: 0.5; }
  50% { transform: translate(-5%, 4%); opacity: 0.7; }
}

@keyframes fog3 {
  0%, 100% { transform: translate(0, 0); opacity: 0.55; }
  50% { transform: translate(3%, 3%); opacity: 0.75; }
}

@media (prefers-reduced-motion: reduce) {
  .fog__layer {
    animation: none;
    opacity: 0.5;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Navigation
   ═══════════════════════════════════════════════════════════════ */
.nav {
  position: relative;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(238, 242, 244, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
}

.nav__brand {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-main);
  text-decoration: none;
}

.nav__brand:hover {
  color: var(--accent-main);
}

.nav__links {
  display: flex;
  gap: 28px;
}

.nav__link {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav__link:hover,
.nav__link--active {
  color: var(--text-main);
}

@media (max-width: 540px) {
  .nav {
    padding: 0 16px;
  }
  .nav__links {
    gap: 18px;
  }
  .nav__link {
    font-size: 12px;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════════════════════════ */
.wrap {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 48px 24px;
}

.content {
  width: 100%;
  max-width: var(--content-width);
}

/* Hero layout (index) */
.hero-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

.hero {
  position: relative;
  text-align: center;
  max-width: 480px;
}

/* ═══════════════════════════════════════════════════════════════
   Hero (index.html)
   ═══════════════════════════════════════════════════════════════ */
.hero__logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 24px;
  position: relative;
  z-index: 1;
}

.hero__logo svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 12px rgba(46, 58, 64, 0.1));
}

.hero__title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-main);
  margin: 0 0 32px;
  position: relative;
  z-index: 1;
}

.hero__lead {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 0 8px;
  position: relative;
  z-index: 1;
}

.hero__main {
  font-size: 32px;
  font-weight: 500;
  color: var(--text-main);
  margin: 0 0 12px;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.hero__sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 32px;
  position: relative;
  z-index: 1;
}

.hero__cta {
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════
   Typography
   ═══════════════════════════════════════════════════════════════ */
.page-title {
  font-size: 26px;
  font-weight: 500;
  color: var(--text-main);
  margin: 0 0 8px;
  line-height: 1.3;
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 0 32px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

p {
  margin: 0 0 16px;
}

p:last-child {
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid var(--border-medium);
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--accent-main);
}

.btn:active {
  transform: translateY(1px);
}

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

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

.btn--ghost {
  background: transparent;
  border-color: var(--border-light);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.4);
  border-color: var(--border-medium);
}

.btn + .btn {
  margin-left: 12px;
}

/* ═══════════════════════════════════════════════════════════════
   Cards
   ═══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.card:last-child {
  margin-bottom: 0;
}

.card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin: 0 0 8px;
}

.card__text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.55;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 540px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Highlight Box
   ═══════════════════════════════════════════════════════════════ */
.highlight {
  background: rgba(111, 136, 154, 0.08);
  border-left: 3px solid var(--accent-main);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 6px 6px 0;
}

.highlight p {
  margin: 0;
  font-size: 14px;
  color: var(--text-main);
}

/* ═══════════════════════════════════════════════════════════════
   Divider
   ═══════════════════════════════════════════════════════════════ */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: 32px 0;
  border: none;
}

/* ═══════════════════════════════════════════════════════════════
   Forms
   ═══════════════════════════════════════════════════════════════ */
.form-section {
  margin-bottom: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-main);
  font-size: 14px;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.form-input:focus {
  border-color: var(--accent-main);
  box-shadow: 0 0 0 3px rgba(111, 136, 154, 0.1);
}

.form-input--error {
  border-color: rgba(140, 100, 100, 0.5);
}

.form-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.form-error {
  font-size: 12px;
  color: rgba(130, 90, 90, 0.9);
  margin-top: 6px;
  display: none;
}

.form-error--visible {
  display: block;
}

/* ═══════════════════════════════════════════════════════════════
   Question Block (Assessment)
   ═══════════════════════════════════════════════════════════════ */
.question {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.question__number {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-main);
  margin-bottom: 8px;
}

.question__text {
  font-size: 14px;
  color: var(--text-main);
  margin: 0 0 16px;
  line-height: 1.5;
}

/* Likert Scale */
.likert {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.likert__options {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.likert__option {
  flex: 1;
  max-width: 56px;
}

.likert__option input {
  display: none;
}

.likert__option label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.likert__option label:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--accent-main);
}

.likert__option input:checked + label {
  background: var(--accent-main);
  border-color: var(--accent-main);
  color: #fff;
}

.likert__option input:focus + label {
  box-shadow: 0 0 0 2px rgba(111, 136, 154, 0.3);
}

.likert__labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 0 4px;
}

/* ═══════════════════════════════════════════════════════════════
   Result Display
   ═══════════════════════════════════════════════════════════════ */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.result-row:last-child {
  border-bottom: none;
}

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

.result-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

.result-value--code {
  font-family: var(--font-mono);
  font-size: 13px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-medium);
  border-radius: 8px;
  margin-bottom: 24px;
}

.empty-state p {
  color: var(--text-secondary);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Form Status Message
   ═══════════════════════════════════════════════════════════════ */
.form-status {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  margin-top: 16px;
  min-height: 44px;
  display: none;
}

.form-status--visible {
  display: block;
}

.form-status--processing {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════════════════ */
.footer {
  padding: 24px;
  border-top: 1px solid var(--border-light);
  background: rgba(238, 242, 244, 0.5);
}

.footer__inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__links {
  display: flex;
  gap: 24px;
}

.footer__link {
  font-size: 12px;
  color: var(--text-secondary);
  text-decoration: none;
}

.footer__link:hover {
  color: var(--text-main);
}

.footer__copy {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.7;
}

@media (max-width: 540px) {
  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

/* ═══════════════════════════════════════════════════════════════
   Utilities
   ═══════════════════════════════════════════════════════════════ */
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--accent-main);
  outline-offset: 2px;
}

/* Print */
@media print {
  .bg, .fog, .nav { display: none; }
  .wrap { min-height: auto; }
}
