/**
 * MEUME Stylesheet
 * Brand: Smart Artse
 * Visual Identity: Dark Purple (#111023, #201d36, #31204b) & Vibrant Lime (#b3f57e)
 * Mobile-first, responsive, accessible, printable certificates.
 */

:root {
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-dark: #111023;
  --bg-gradient: radial-gradient(ellipse at top right, #31204b, #111023 65%);
  --card-bg: #201d36;
  --card-border: #3c3654;
  --card-hover: #292445;
  --accent: #b3f57e;
  --accent-text: #112008;
  --text-main: #f7f4ff;
  --text-muted: #b9b5d1;
  --text-sub: #8e88ad;
  --danger: #cf4f68;
  --danger-bg: #4f1d29;
  --prio-high: #f59e0b;
  --prio-med: #38bdf8;
  --prio-low: #a3e635;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

header, main, footer {
  max-width: 1040px;
  margin: auto;
  padding: 24px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 20px;
}

.logo {
  font-weight: 900;
  letter-spacing: -1.5px;
  font-size: 28px;
  color: var(--text-main);
}

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

.brand-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.pill {
  border: 1px solid #55506d;
  border-radius: 30px;
  padding: 7px 14px;
  font-size: 12px;
  color: #c6c2d9;
  background: rgba(255, 255, 255, 0.03);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

h1 {
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.12;
  letter-spacing: -1.5px;
  margin: 20px 0 10px;
}

h2 {
  font-size: 24px;
  letter-spacing: -0.5px;
  margin-top: 0;
}

h3 {
  font-size: 19px;
  margin: 12px 0 6px;
}

h4 {
  font-size: 16px;
  margin: 0;
}

p {
  color: var(--text-muted);
  line-height: 1.6;
  margin: 8px 0 16px;
}

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

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}

/* Steps Indicator */
.steps {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 24px 0;
}

.step {
  flex: 1;
  min-width: 140px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: #2b2742;
  text-align: center;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.step small {
  display: block;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 6px;
  font-size: 12px;
}

/* Form Controls & Buttons */
button {
  cursor: pointer;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 750;
  background: var(--accent);
  color: var(--accent-text);
  transition: transform 0.15s ease, filter 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

button.secondary {
  background: #3b3555;
  color: white;
}

button.danger {
  background: var(--danger-bg);
  color: #ffadb9;
  border: 1px solid rgba(207, 79, 104, 0.4);
}

button.small {
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 6px;
}

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid #575070;
  background: #141329;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  margin-top: 4px;
}

textarea {
  min-height: 95px;
  resize: vertical;
}

label {
  display: block;
  margin: 14px 0 4px;
  color: #e2deee;
  font-weight: 650;
  font-size: 14px;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.row > * {
  flex: 1;
}

.row button {
  flex: 0 0 auto;
}

.hide {
  display: none !important;
}

/* Progress bar */
.progress-bar-wrap {
  height: 9px;
  background: #39334e;
  border-radius: 12px;
  overflow: hidden;
  margin: 14px 0;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.25s ease;
}

/* Rating Scale */
.rating-scale-container {
  margin: 14px 0;
}

.rating-labels-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.rating-btn-row {
  display: flex;
  gap: 8px;
}

.rating-btn {
  flex: 1;
  padding: 14px 8px;
  background: #2b2644;
  color: #fff;
  border: 1px solid #4a4369;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 800;
}

.rating-btn:hover {
  background: #393358;
}

.rating-btn.selected {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

/* Choice Buttons */
.choice-list-container {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.choice-option-btn {
  width: 100%;
  text-align: left;
  padding: 14px 18px;
  background: #27223e;
  border: 1px solid #484166;
  border-radius: 12px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
}

.choice-option-btn:hover {
  background: #342e52;
}

.choice-option-btn.selected {
  background: #1e3a24;
  border-color: var(--accent);
  color: var(--accent);
}

/* Full Form Assessment */
.full-form-cat-card {
  background: #1c1830;
  border: 1px solid #37304e;
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 18px 0;
}

.full-form-cat-header h3 {
  margin: 0;
}

.full-form-cat-header small {
  color: var(--text-sub);
}

.full-form-q-row {
  margin: 18px 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Profile Cards (ME TODAY & FUTURE ME) */
.profile-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 20px 0;
}

.profile-card {
  background: linear-gradient(145deg, #241f3d, #1b172f);
  border: 1px solid #433c5e;
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.profile-card-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.profile-card-badge.accent-badge {
  color: var(--accent);
}

.profile-card-date {
  font-size: 13px;
  color: var(--text-sub);
  margin: 4px 0 10px;
}

.profile-card-summary {
  font-size: 15px;
  color: #e3dfee;
  margin: 8px 0 14px;
  flex-grow: 1;
}

.profile-tags-row {
  font-size: 12px;
  color: var(--text-sub);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tag {
  font-size: 11px;
  padding: 3px 8px;
  background: #3e3657;
  border-radius: 8px;
  color: #ddd;
}

.tag.accent-tag {
  background: rgba(179, 245, 126, 0.15);
  color: var(--accent);
  border: 1px solid rgba(179, 245, 126, 0.3);
}

.tag.priority-high {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.tag.priority-medium {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.tag.priority-low {
  background: rgba(163, 230, 53, 0.15);
  color: #bef264;
}

.tag.muted-tag {
  background: #2b2742;
  color: var(--text-sub);
}

.profile-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.tabs button {
  background: #28233f;
  color: #d1cde0;
  border: 1px solid #3c3654;
  border-radius: 10px;
}

.tabs button.active {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 800;
}

/* Task checklist items */
.task {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: #26213e;
  border: 1px solid #393252;
  margin-bottom: 10px;
}

.task input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.task-details {
  flex: 1;
}

.task-text {
  font-size: 15px;
  font-weight: 600;
  color: #f7f4ff;
  display: block;
}

.task.done .task-text {
  text-decoration: line-through;
  opacity: 0.55;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}

.task-instructions {
  display: block;
  width: 100%;
  color: var(--text-sub);
  margin-top: 4px;
  font-size: 12px;
}

.task-actions-row {
  display: flex;
  gap: 6px;
}

/* Goals in Future ME */
.goal-card {
  background: #1c1830;
  border: 1px solid #3d3558;
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 14px;
}

.goal-card.paused {
  opacity: 0.65;
  border-style: dashed;
}

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

.goal-meta-row {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
  margin: 10px 0;
  flex-wrap: wrap;
}

.goal-milestones-list {
  background: #141224;
  padding: 12px;
  border-radius: 8px;
  margin: 10px 0;
  font-size: 13px;
}

.goal-milestones-list ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.goal-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Journal Entry Card */
.journal-entry-card {
  background: #1d1933;
  border: 1px solid #383152;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.journal-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.stat-box {
  background: #1b1730;
  border: 1px solid #3a3254;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.stat-box strong {
  display: block;
  font-size: 28px;
  color: var(--accent);
}

.stat-box span {
  font-size: 12px;
  color: var(--text-sub);
}

.history-item-row {
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.history-item-date {
  font-size: 12px;
  color: var(--text-sub);
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 18, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-dialog {
  background: #1e1b36;
  border: 1px solid #484166;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.modal-close-btn {
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  padding: 4px;
}

/* Floating MEUME HUD */
.meume-hud-floating {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background: rgba(28, 24, 48, 0.96);
  border: 1px solid #554d75;
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  z-index: 900;
  backdrop-filter: blur(10px);
}

.hud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.hud-brand {
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.hud-countdown {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  margin: 10px 0 4px;
}

.hud-status {
  font-size: 11px;
  color: var(--text-sub);
}

.hud-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.hud-task-row span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.hud-task-row.done span {
  text-decoration: line-through;
  opacity: 0.55;
}

.hud-timer-box {
  background: #141224;
  border-radius: 8px;
  padding: 8px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hud-timer-digits {
  font-family: monospace;
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}

.meume-hud-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--card-bg);
  border: 1px solid var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* MATE Assistant Speech Card */
.mate-speech-card {
  background: #1a172c;
  border: 1px solid #4a416b;
  border-left: 5px solid var(--accent);
  border-radius: 12px;
  padding: 18px;
  margin: 16px 0;
}

.mate-avatar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.mate-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Certificate View & Print Styles */
.certificate-paper {
  background: #fff;
  color: #1a1a2e;
  padding: 36px;
  border: 6px double #31204b;
  border-radius: 8px;
  font-family: Georgia, 'Times New Roman', serif;
}

.certificate-paper h2 {
  color: #1a1436;
  text-align: center;
  margin-bottom: 4px;
}

.certificate-paper .cert-header {
  text-align: center;
  border-bottom: 2px solid #5e4785;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.certificate-paper .cert-footer {
  text-align: center;
  font-style: italic;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px dashed #999;
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  header, footer, nav, .meume-hud-floating, .meume-hud-pill, .tabs, button {
    display: none !important;
  }
  .modal {
    position: static;
    background: none;
    padding: 0;
  }
  .modal-dialog {
    border: none;
    box-shadow: none;
    max-width: 100%;
    padding: 0;
  }
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #25203d;
  border: 1px solid var(--accent);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInToast 0.25s ease-out;
  pointer-events: auto;
}

@keyframes slideInToast {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 720px) {
  header, main {
    padding: 16px;
  }
  .profile-cards-grid {
    grid-template-columns: 1fr;
  }
  .meume-hud-floating {
    width: calc(100% - 32px);
    right: 16px;
    bottom: 16px;
  }
  .steps {
    flex-direction: column;
  }
}
