:root {
    --background: 0 0% 100%; /* White background */
    --foreground: 198 80% 21%; /* Dark blue text (replaces black) */
    --card: 0 0% 100%; /* White card background */
    --card-foreground: 198 80% 21%; /* Dark blue text for cards */
    --popover: 0 0% 100%;
    --popover-foreground: 198 80% 21%;
    --primary: 186 56% 45%; /* Main blue: #33A7B5 */
    --primary-foreground: 0 0% 98%; /* Near-white text for primary */
    --secondary: 162 56% 84%; /* Light blue: #B6E3D4 */
    --secondary-foreground: 186 56% 45%; /* Main blue text for secondary */
    --muted: 210 40% 96%; /* Light blue-gray muted */
    --muted-foreground: 215 16% 47%; /* Medium gray text */
    --accent: 162 56% 84%; /* Light blue accent */
    --accent-foreground: 186 56% 45%; /* Main blue text for accent */
    --destructive: 0 84% 60%; /* Red for errors */
    --destructive-foreground: 0 0% 98%; /* White text for destructive */
    --border: 214 32% 91%; /* Light purple-gray border */
    --input: 214 32% 91%; /* Light purple-gray for inputs */
    --ring: 186 56% 45%; /* Main blue for focus rings */
    --forest-primary: 186 56% 45%; /* Main blue (replaces forest) */
    --forest-light: 162 56% 84%; /* Light blue (replaces light green) */
    --earth-blue: 186 56% 45%; /* Main blue */
    --earth-blue-light: 162 56% 84%; /* Light blue */
    --success: 186 56% 45%; /* Main blue for success */
    --warning: 43 96% 56%; /* Yellow for warnings */
    --shadow-card: 0 2px 8px -2px rgba(0, 0, 0, 0.08);
    --shadow-elevated: 0 8px 25px -8px rgba(0, 0, 0, 0.1);
    --radius: .5rem;
    --sidebar-background: 0 0% 98%;
    --sidebar-foreground: 198 80% 21%;
    --sidebar-primary: 198 80% 21%;
    --sidebar-primary-foreground: 0 0% 98%;
    --sidebar-accent: 162 56% 84%;
    --sidebar-accent-foreground: 186 56% 45%;
    --sidebar-border: 220 13% 91%;
    --sidebar-ring: 186 56% 45%;
}

* {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: hsl(var(--border));
}

/* FONT CHANGE: Replace system font with DM Sans + DM Mono */
html, :host {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -moz-tab-size: 4;
    tab-size: 4;
    font-family: "DM Sans", "DM Mono", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", Segoe UI Symbol, "Noto Color Emoji";
    font-feature-settings: normal;
    font-variation-settings: normal;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    background: linear-gradient(145deg, #fdfdfd, #f0f8f7) !important;
    color: #000;
    padding: 20px 0;
    font-size: 16px;
    font-family: "DM Sans", sans-serif;
    font-weight: 400;
}

.login-page {
    background: linear-gradient(to bottom right,
        hsl(162 56% 96%),   /* Very light #B6E3D4 tint */
        hsl(0 0% 100%),
        hsl(162 56% 96%)
    );
    min-height: 100vh;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: -20px -20px -20px 0;
    padding: 0;
    box-sizing: border-box;
    width: 100%;
}

.login-page .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.header {
    text-align: left;
    position: relative;
    margin-bottom: 20px;
    background: rgba(142, 209, 252, 0.5) !important; /* #8ed1fc at 50% */
    color: hsl(var(--foreground)); /* Dark blue */
    padding: 20px 40px;
}

.header h1 {
    font-size: 48px;
    margin: 0;
    font-family: "DM Sans", sans-serif;
    font-weight: 600;
    color: hsl(198, 80%, 21%); /* Dark blue */
}

.header h2 {
    font-size: 24px;
    margin: 0;
    font-family: "DM Sans", sans-serif;
    font-weight: 600;
    color: hsl(198, 80%, 21%); /* Dark blue */
}

.header-logo {
    height: 63px;
    float: right;
    position: absolute;
    top: 4px;
    right: 40px;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
    padding: 0 20px;
}

#email-form {
    text-align: center;
    padding: 30px;
    background: hsl(var(--card));
    border: 2px solid hsl(var(--border));
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    width: 500px;
    margin-bottom: 20px;
}

#email-form h2 {
    color: hsl(198, 80%, 21%); /* Dark blue */
    font-size: 24px;
    margin: 0 0 15px 0;
    font-family: "DM Sans", sans-serif;
    font-weight: 600;
}

#email-form p {
    margin-bottom: 15px;
    color: hsl(var(--card-foreground));
}

#user-email {
    width: 80%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius);
    color: hsl(var(--card-foreground));
}

#user-email::placeholder {
    color: hsl(var(--muted-foreground));
    opacity: 0.7;
}

button {
    padding: 10px 20px;
    font-size: 16px;
    background: linear-gradient(to right, hsl(var(--forest-primary)), hsl(var(--primary)));
    color: hsl(var(--primary-foreground));
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    font-family: "DM Mono", monospace;
    font-weight: 500;
}

button:hover:not(.loading) {
    background: #bfe8ed !important;
    transition: background 0.3s ease;
}

button.loading {
    cursor: not-allowed;
}

button.loading .button-text {
    display: none;
}

button.loading .spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid hsl(var(--primary-foreground));
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

button.loading::before {
    content: "Loading";
    color: hsl(var(--primary-foreground));
}

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

#error-msg {
    color: hsl(var(--destructive));
}

/* Evaluation Page Styles */

.split-section {
    display: flex;
    width: 100%;
    max-width: 1400px;
    gap: 20px;
}

.left-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.kobo-form-section {
    flex: 1;
    width: 50%;
}

.kobo-form-section iframe {
    visibility: hidden;
    pointer-events: none;
}

.kobo-form-section iframe:focus {
    outline: none;
}

.kobo-form-section iframe.loaded {
    visibility: visible;
    pointer-events: auto;
}

.contextual-section, .domain-specific-section, .kobo-form-section {

    background: hsl(var(--card));
    border: 2px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: var(--shadow-card);
}

.contextual-section h2, .domain-specific-section h2 {
    color: hsl(198, 80%, 21%); /* Dark blue */
    font-size: 24px;
    margin: 0 0 10px 0;
    font-family: "DM Sans", sans-serif;
    font-weight: 600;
}

.contextual-section p, .domain-specific-section p {
    color: hsl(var(--card-foreground));
    font-size: 14px;
}

.kobo-form-section iframe {
    width: 100%;
    height: 1080px;
    border: none;
}

.contextual-section iframe, .domain-specific-section iframe {
    width: 100%;
    height: 400px;
    border: none;
}

.qa-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.qa-table th, .qa-table td {
    border: 1px solid hsl(var(--border));
    padding: 10px;
    text-align: left;
    color: hsl(var(--card-foreground));
}

.qa-table th {
    background: rgb(220, 234, 237) !important;
    color: #000 !important;
    font-size: 16px;
}

.qa-table td {
    background: hsl(var(--card));
    font-size: 16px;
}

/* PERFECT 50/50 SPLIT — FINAL FIX */
.split-section {
    display: flex;
    gap: 20px;
    max-width: 1400px;
    width: 100%;
}
.tool-info-card,
.kobo-form-section {
    flex: 1;
    min-width: 0;
}
.kobo-form-section iframe {
    width: 100% !important;
    min-width: 600px;
}

.kobo-form-section h2 {
    background: rgba(142, 209, 252, 0.5) !important; /* #8ed1fc at 50% */
    padding: 16px 24px;
    margin: -20px -20px 20px -20px;
    border-radius: var(--radius) var(--radius) 0 0;
    font-size: 24px;
    font-weight: 600;
    color: #000 !important;
    font-family: "DM Sans", sans-serif;
}

#dimension-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-style: normal !important;
    color: hsl(var(--muted-foreground)) !important;
    background: hsl(var(--card));
    border: 2px solid hsl(var(--border));
    border-radius: var(--radius);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7280' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    cursor: pointer;
    transition: all 0.2s;
    font-family: "DM Mono", monospace;
    font-weight: 500;
}
#dimension-select:hover {
    border-color: hsl(var(--primary));
}

#dimension-select option:hover {
    background: hsl(162 56% 92%) !important;
    color: hsl(var(--foreground)) !important;
}
#dimension-select:focus-within option:hover {
    background: hsl(162 56% 92%) !important;
    color: hsl(var(--foreground)) !important;
}

#email-form img {
    height: 100px !important;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

#user-email,
#submit-btn {
    width: 80% !important;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

#user-email {
    transition: all 0.2s ease;
}
#user-email:focus {
    border-color: hsl(var(--primary)) !important;
    box-shadow: 0 0 0 4px hsl(var(--primary)/0.25) !important;
    outline: none;
}

/* ============================================================= */
/* MDII USER GUIDE – FINAL 100% PIXEL-PERFECT VERSION            */
/* Matches https://clsfrj-5173.csb.app/domain-user-guide EXACTLY */
/* ============================================================= */

:root {
  --background: 186 43% 94%;      /* #ccfbf1 → very light cyan-blue */
  --foreground: 240 10% 4%;       /* #0f172a */
  --primary: 173 77% 25%;         /* #0f766e → exact blue border & accents */
  --light-blue: 186 28% 90%;
  --muted: 210 20% 98%;
  --muted-foreground: 240 4% 46%;
}

.mdii-guide {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: hsl(var(--background));   /* ← Exact original iframe background */
  min-height: 100vh;
  padding: 2rem 1rem;
}

.mdii-container {
  max-width: 80rem;                     /* ← Matches original Tailwind container (1280px) */
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Main Onboarding Card */
.onboarding-card {
  background: white;
  border: 1px solid #0d9488;  /* ← Exact original blue border */
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-header {
  padding: 32px;
  display: flex;
  gap: 16px;
  background: white;
}

.header-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: #ccfbf1;     /* #ccfbf1 */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--primary));
}

.card-title {
  font-size: 1.375rem !important;
  font-weight: 700;
  margin: 0 0 1.5rem 0;
  color: #0f766e !important;
}

.section-title {
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  font-size: 0.875rem;
  color: #111827;
}

.intro-text p {
  font-size: 0.875rem;
  line-height: 1.75;
  color: #374151;
  margin-bottom: 0.75rem;
}

/* Highlight boxes */
.highlight-box {
  background: #bfe8ed !important;
  border-left: 4px solid hsl(var(--primary));
  padding: 12px 16px;
  border-radius: 0 4px 4px 0;
  margin: 1.5rem 0;
}

.highlight-box p {
  margin: 0;
  font-size: 0.875rem;
  color: #111827;
}

.highlight-box .bold { font-weight: 600; }

/* Collapsibles */
.collapsible {
  border-top: 1px solid #e5e7eb;
}

.collapsible-trigger {
  width: 100%;
  background: white;
  border: none;
  padding: 12px 24px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: #111827;
  cursor: pointer;
  transition: background 0.2s;
  justify-content: flex-start !important;   /* ensures perfect left alignment */
}

.collapsible-trigger:hover {
  background: #bfe8ed !important;
}

.chevron {
  transition: transform 0.3s;
  width: 16px;
  height: 16px;
}

.collapsible-trigger.active .chevron {
  transform: rotate(180deg);
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.collapsible-content.open {
  max-height: 3000px;
}

.content-padding {
  padding: 1.5rem 2rem;       /* 24px top-bottom, 32px left-right */
  font-size: 0.875rem;
  line-height: 1.7;
  color: #374151;
}

@media (min-width: 768px) {
  .content-padding {
    padding-left: 4rem;       /* 64px on desktop only */
  }
}

.section-divider {
  border-top: 1px solid #d1d5db;
  margin: 24px 0;
}

.divider {
  margin: 0;
  border-color: #e5e7eb;
}

/* Dimensions Section */
.dimensions-section {
  margin-top: 3rem;
}

.dimensions-nav-wrapper {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.dimensions-nav-wrapper::-webkit-scrollbar {
  height: 6px;
}

.dimensions-nav-wrapper::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.dimensions-nav {
  display: flex;
  gap: 4px;
  min-width: max-content;
}

.dim-btn {
  white-space: nowrap;
  padding: 8px 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.dim-btn:hover {
  background: #fef9c3;     /* ← Exact pale yellow hover */
  font-weight: 600;
}

.dim-btn.active {
  background: white;
  color: #111827;
  font-weight: 600;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.dimension-detail-card {
  margin-top: 24px;
  background: white;
  padding: 24px;
  border-radius: 8px;
  min-height: 220px;
}

.detail-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: #111827;
}

.detail-short {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }
  .detail-grid > div:last-child {
    border-left: 1px solid #e5e7eb;
    padding-left: 24px;
  }
}

.detail-subtitle {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #111827;
}

.detail-text {
  font-size: 0.875rem;
  line-height: 1.7;
  color: #4b5563;
}

.text-gray-700 { color: #374151; }
.text-gray-500 { color: #6b7280; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.font-light { font-weight: 300; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.italic { font-style: italic; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-12 { margin-top: 3rem; }
.pl-6 { padding-left: 1.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.list-disc { list-style-type: disc; }
.list-decimal { list-style-type: decimal; }
