/*
Theme Name: Quiz Portal
Theme URI: https://example.com/quiz-portal
Author: Custom
Description: Modern, responsive app-style theme with AJAX login, signup, and forgot password. Dark blue & white login; modern app dashboard.
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: quiz-portal
Tags: custom-logo, custom-menu, featured-images, full-width-template, one-column, responsive-layout, theme-options, translation-ready, two-columns
*/

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
  --qp-primary: #0d9488;
  --qp-primary-dark: #0f766e;
  --qp-primary-light: #14b8a6;
  --qp-accent: #0891b2;
  --qp-dark: #0f172a;
  --qp-dark-blue: #1e3a5f;
  --qp-dark-blue-light: #2d4a6f;
  --qp-bg: #f8fafc;
  --qp-bg-card: #ffffff;
  --qp-text: #0f172a;
  --qp-text-muted: #64748b;
  --qp-border: #e2e8f0;
  --qp-border-input: #cbd5e1;
  --qp-shadow: 0 1px 3px rgba(0,0,0,0.08);
  --qp-shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
  --qp-radius: 8px;
  --qp-radius-lg: 12px;
  --qp-sidebar-width: 260px;
  --qp-font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --qp-transition: 0.2s ease;
}

/* Responsive base: prevent horizontal overflow, touch-friendly */
.qp-app,
.qp-app-main,
.qp-app-content {
  min-width: 0;
}
.qp-app-content {
  overflow-x: hidden;
}
@media (max-width: 768px) {
  .qp-app {
    -webkit-overflow-scrolling: touch;
  }
}

/* App area uses same dark blue as login left panel */
body.qp-dashboard-app,
body.qp-dashboard-app .qp-app {
  --qp-primary: var(--qp-dark-blue);
  --qp-primary-dark: var(--qp-dark);
  --qp-primary-light: var(--qp-dark-blue-light);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--qp-font-sans);
  background: var(--qp-bg);
  color: var(--qp-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

body.qp-auth-page {
  display: flex;
  flex-direction: column;
}

body.qp-auth-page .qp-auth-wrap {
  flex: 1;
}

/* Auth page footer: shown on mobile only (copyright moved from left panel) */
.qp-auth-page-footer {
  display: none;
  padding: 1rem 1.25rem;
  text-align: center;
  background: var(--qp-bg-card);
  border-top: 1px solid var(--qp-border);
}

.qp-auth-page-footer-text {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--qp-text-muted);
}

a {
  color: var(--qp-primary);
  text-decoration: none;
  transition: color var(--qp-transition);
}

a:hover {
  color: var(--qp-primary-dark);
}

.qp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   AUTH PAGE - Login / Sign up (dark blue left, white form right)
   ========================================================================== */
.qp-auth-wrap {
  display: flex;
  min-height: 100vh;
  flex-wrap: wrap;
}

/* Left panel: dark blue branding */
.qp-auth-visual {
  flex: 1 1 45%;
  min-height: 50vh;
  background: var(--qp-dark-blue);
  background: linear-gradient(160deg, #1e3a5f 0%, #0f172a 100%);
  display: flex;
  flex-direction: column;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.qp-auth-visual-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(56, 189, 248, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(14, 165, 233, 0.3) 0%, transparent 45%);
  pointer-events: none;
}

.qp-auth-visual-pattern::before {
  content: '';
  position: absolute;
  top: 10%;
  right: 15%;
  width: 120px;
  height: 120px;
  border: 2px solid rgba(255,255,255,0.15);
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation: qp-float 8s ease-in-out infinite;
}

.qp-auth-visual-pattern::after {
  content: '';
  position: absolute;
  bottom: 20%;
  left: 10%;
  width: 80px;
  height: 80px;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  animation: qp-float 6s ease-in-out infinite reverse;
}

@keyframes qp-float {
  0%, 100% { transform: translate(0,0) rotate(0deg); }
  50% { transform: translate(10px,-10px) rotate(5deg); }
}

.qp-auth-visual-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.qp-auth-visual-logo img,
.qp-auth-visual-brand {
  display: inline-block;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: auto;
}

.qp-auth-visual-logo img {
  max-height: 40px;
  width: auto;
}

.qp-auth-visual-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  max-width: 360px;
  padding: 2rem 0;
}

.qp-auth-visual-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.qp-auth-visual-content p {
  margin: 0;
  opacity: 0.9;
  font-size: 1rem;
  line-height: 1.6;
}

.qp-auth-visual-copy {
  margin: 0;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.6);
}

/* Right panel: form */
.qp-auth-form-panel {
  flex: 1 1 55%;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 2rem;
  background: var(--qp-bg-card);
  box-shadow: -4px 0 24px rgba(0,0,0,0.06);
  position: relative;
}

.qp-auth-form-brand {
  position: absolute;
  top: 2rem;
  left: 2rem;
  right: 2rem;
  text-align: left;
}

.qp-auth-form-panel .qp-logo {
  margin: 0;
}

.qp-auth-form-panel .qp-logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--qp-text);
  letter-spacing: -0.03em;
}

.qp-auth-form-panel .qp-logo img {
  max-height: 40px;
}

/* Auth form */
.qp-auth-form {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  position: relative;
}

.qp-form-eyebrow {
  font-size: 0.875rem;
  color: var(--qp-text-muted);
  margin: 0 0 0.25rem;
}

.qp-auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--qp-text);
  letter-spacing: -0.02em;
}

.qp-auth-form .qp-form-subtitle {
  color: var(--qp-text-muted);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.qp-form-subtitle .qp-link-cta {
  font-weight: 600;
  text-decoration: underline;
  color: var(--qp-dark-blue);
}

.qp-form-group {
  margin-bottom: 1.25rem;
}

.qp-form-group label:not(.qp-sr-only) {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--qp-text);
}

.qp-form-group input {
  width: 100%;
  padding: 0.625rem 0;
  font-size: 1rem;
  font-family: inherit;
  border: none;
  border-bottom: 1px solid var(--qp-border-input);
  border-radius: 0;
  background: transparent;
  color: var(--qp-text);
  transition: border-color var(--qp-transition);
}

.qp-form-group-underline input:focus {
  outline: none;
  border-bottom-color: var(--qp-dark-blue);
}

.qp-form-group input::placeholder {
  color: #94a3b8;
}

.qp-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.qp-form-row-remember .qp-link-forgot {
  font-size: 0.875rem;
  font-weight: 500;
}

.qp-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--qp-text-muted);
  cursor: pointer;
}

.qp-checkbox-label input {
  width: auto;
  margin: 0;
  padding: 0;
}

.qp-form-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.qp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: var(--qp-radius);
  cursor: pointer;
  transition: background var(--qp-transition), border-color var(--qp-transition), transform 0.1s ease;
}

.qp-btn:active {
  transform: scale(0.98);
}

.qp-btn-block {
  width: 100%;
}

.qp-btn-primary {
  background: var(--qp-dark);
  color: #fff;
}

.qp-btn-primary:hover {
  background: var(--qp-dark-blue);
}

.qp-btn-google {
  background: #fff;
  color: var(--qp-text);
  border: 1px solid var(--qp-border);
}

.qp-btn-google:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.qp-btn-google[disabled] {
  opacity: 0.7;
  cursor: default;
}

.qp-btn-google-icon {
  font-size: 1.125rem;
  font-weight: 700;
  margin-right: 0.5rem;
  color: #4285f4;
}

.qp-form-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  color: var(--qp-text-muted);
}

.qp-form-footer a {
  font-weight: 500;
  text-decoration: underline;
}

/* Auth views */
.qp-auth-view {
  display: none;
  width: 100%;
  max-width: 400px;
  animation: qp-fadeIn 0.3s ease;
}

.qp-auth-view.is-active {
  display: block;
}

@keyframes qp-fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.qp-message {
  padding: 0.75rem 1rem;
  border-radius: var(--qp-radius);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  display: none;
}

.qp-message.is-visible {
  display: block;
}

.qp-message--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.qp-message--success {
  background: #f0fdfa;
  color: var(--qp-primary-dark);
  border: 1px solid #99f6e4;
}

.qp-btn.is-loading {
  pointer-events: none;
  opacity: 0.8;
}

.qp-btn.is-loading::after {
  content: '';
  width: 18px;
  height: 18px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: qp-spin 0.6s linear infinite;
}

@keyframes qp-spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   DASHBOARD APP - Sidebar + main (modern web app)
   ========================================================================== */
body.qp-dashboard-app .qp-main {
  margin: 0;
  padding: 0;
}

.qp-app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar: same dark blue as login left panel so logo (white/color) fits */
.qp-sidebar {
  width: var(--qp-sidebar-width);
  min-width: var(--qp-sidebar-width);
  background: var(--qp-dark-blue);
  background: linear-gradient(180deg, #1e3a5f 0%, #0f172a 100%);
  border-right: none;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.qp-sidebar-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.qp-sidebar-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  text-decoration: none;
}

.qp-sidebar-logo .qp-app-logo-img,
.qp-sidebar-logo img {
  max-height: 65px;
  width: auto;
  display: block;
  vertical-align: middle;
  object-fit: contain;
}

.qp-sidebar-header .qp-logo-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.qp-sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  list-style: none;
  margin: 0;
}

.qp-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 1.25rem;
  margin: 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  border-radius: var(--qp-radius);
  transition: color var(--qp-transition), background var(--qp-transition);
}

.qp-sidebar-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.qp-sidebar-nav a.qp-nav-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-left: 3px solid rgba(255, 255, 255, 0.9);
  margin-left: 0.5rem;
  padding-left: calc(1.25rem - 3px);
}

.qp-sidebar-nav .material-symbols-outlined {
  font-size: 22px;
  width: 22px;
  height: 22px;
  opacity: 0.9;
  flex-shrink: 0;
}

.qp-sidebar-nav a.qp-nav-active .material-symbols-outlined {
  opacity: 1;
}

.qp-sidebar-nav a.qp-sidebar-cta-inline {
  background: rgba(5, 150, 105, 0.2);
  color: #6ee7b7;
  margin: 0.5rem;
  border-radius: var(--qp-radius);
}
.qp-sidebar-nav a.qp-sidebar-cta-inline:hover {
  background: rgba(5, 150, 105, 0.3);
  color: #fff;
}
.qp-sidebar-nav a.qp-sidebar-cta-inline .material-symbols-outlined {
  opacity: 1;
}

.qp-sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.qp-sidebar-upgrade {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--qp-radius);
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  text-decoration: none;
  transition: background var(--qp-transition), color var(--qp-transition);
}

.qp-sidebar-upgrade:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.qp-sidebar-upgrade .material-symbols-outlined {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

/* Material Symbols Outlined - ensure icons render (font loaded via Google) */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.qp-app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--qp-bg);
}

/* Offcanvas (mobile menu) - hidden on desktop, shown as overlay on mobile */
.qp-offcanvas-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--qp-transition), visibility var(--qp-transition);
}

.qp-offcanvas-panel {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  max-width: 85vw;
  height: 100%;
  background: var(--qp-dark-blue);
  background: linear-gradient(180deg, #1e3a5f 0%, #0f172a 100%);
  box-shadow: 4px 0 24px rgba(0,0,0,0.2);
  z-index: 1001;
  overflow-y: auto;
  transition: transform 0.25s ease;
  flex-direction: column;
}

@media (max-width: 768px) {
  .qp-offcanvas-panel {
    display: flex;
  }
}

.qp-offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.qp-offcanvas-panel .qp-sidebar-logo .qp-app-logo-img,
.qp-offcanvas-panel .qp-sidebar-logo img {
  max-height: 65px;
}

.qp-offcanvas-panel .qp-logo-text {
  color: #fff;
  font-weight: 700;
}

.qp-offcanvas-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--qp-radius);
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8);
  transition: background var(--qp-transition), color var(--qp-transition);
}

.qp-offcanvas-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.qp-offcanvas-close .material-symbols-outlined {
  font-size: 24px;
  width: 24px;
  height: 24px;
}

.qp-offcanvas-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.qp-offcanvas-nav a {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 1.25rem;
  margin: 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  border-radius: var(--qp-radius);
  transition: color var(--qp-transition), background var(--qp-transition);
}

.qp-offcanvas-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.qp-offcanvas-nav a.qp-nav-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-left: 3px solid rgba(255, 255, 255, 0.9);
  margin-left: 0.5rem;
  padding-left: calc(1.25rem - 3px);
}

.qp-offcanvas-nav a.qp-sidebar-cta-inline {
  background: rgba(5, 150, 105, 0.25);
  color: #6ee7b7;
}
.qp-offcanvas-nav a.qp-sidebar-cta-inline:hover {
  background: rgba(5, 150, 105, 0.35);
  color: #fff;
}

.qp-offcanvas-nav .material-symbols-outlined {
  font-size: 22px;
  width: 22px;
  height: 22px;
  opacity: 0.9;
  flex-shrink: 0;
}

.qp-offcanvas-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.qp-offcanvas-footer .qp-sidebar-upgrade {
  margin: 0;
  justify-content: center;
}

.qp-app-topbar {
  padding: 1rem 1.5rem;
  background: var(--qp-bg-card);
  border-bottom: 1px solid var(--qp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.qp-app-greeting {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--qp-text);
  margin: 0;
}

.qp-app-topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.qp-topbar-cta {
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.qp-btn-cta {
  background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}
.qp-btn-cta:hover {
  background: linear-gradient(135deg, #047857 0%, #0f766e 100%);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}
.qp-btn-secondary {
  background: #f1f5f9;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}
.qp-btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.qp-btn-ghost {
  background: transparent;
  color: var(--qp-text-muted);
  border: 1px solid transparent;
}
.qp-btn-ghost:hover {
  background: #f8fafc;
  color: #0f172a;
}
.qp-btn-icon {
  font-size: 20px;
  width: 20px;
  height: 20px;
}

.qp-user-dropdown-wrap {
  position: relative;
}

.qp-user-dropdown-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--qp-border);
  cursor: pointer;
  overflow: hidden;
  transition: background var(--qp-transition), transform 0.1s ease;
}

.qp-user-dropdown-trigger:hover {
  background: var(--qp-dark-blue);
}

.qp-user-dropdown-trigger:focus {
  outline: 2px solid var(--qp-dark-blue);
  outline-offset: 2px;
}

.qp-user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qp-user-avatar-initials {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--qp-dark-blue);
}

.qp-user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 180px;
  background: var(--qp-bg-card);
  border-radius: var(--qp-radius);
  box-shadow: var(--qp-shadow-lg);
  border: 1px solid var(--qp-border);
  padding: 0.5rem 0;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--qp-transition), visibility var(--qp-transition), transform var(--qp-transition);
}

.qp-user-dropdown[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.qp-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 1rem;
  border: none;
  background: none;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--qp-text);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--qp-transition);
}

.qp-user-dropdown-item:hover {
  background: var(--qp-bg);
}

.qp-user-dropdown-item .material-symbols-outlined {
  font-size: 20px;
  width: 20px;
  height: 20px;
  color: var(--qp-text-muted);
}

.qp-user-dropdown-item.qp-logout:hover {
  color: #b91c1c;
  background: #fef2f2;
}

.qp-user-dropdown-item.qp-logout .material-symbols-outlined {
  color: inherit;
}

/* Demo icon: prevent stray "outline" text (single glyph) */
.qp-icon-fix {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ==========================================================================
   App page layout (unified across Dashboard, Purchase Exam, My Exams, etc.)
   ========================================================================== */
.qp-page {
  max-width: 100%;
  margin: 0;
  width: 100%;
}

.qp-page__header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--qp-border);
}

.qp-page__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--qp-text);
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}

.qp-page__subtitle {
  font-size: 0.9375rem;
  color: var(--qp-text-muted);
  margin: 0;
  line-height: 1.5;
}

.qp-page__body {
  min-height: 120px;
}

.qp-page-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--qp-bg-card);
  border-radius: var(--qp-radius-lg);
  border: 1px solid var(--qp-border);
  box-shadow: var(--qp-shadow);
}

.qp-page-empty__icon {
  font-size: 2.5rem;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--qp-text-muted);
  display: block;
  margin: 0 auto 1rem;
  opacity: 0.8;
}

.qp-page-empty__text {
  margin: 0 0 1rem;
  color: var(--qp-text-muted);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.qp-page-empty .qp-btn {
  margin-top: 0.5rem;
}

/* ==========================================================================
   Purchase Exam: table layout (Exam | Price | Buy) – borders, spacing, sleek
   ========================================================================== */
/* Exam expiry notice on Purchase page */
.qp-exam-expiry-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  color: #0c4a6e;
}
.qp-exam-expiry-notice__icon {
  font-size: 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.qp-exam-expiry-notice__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.qp-page__body .qp-exam-table-wrap {
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.qp-exam-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.9375rem;
}

.qp-exam-table__head {
  background: #f8fafc;
}

.qp-exam-table__head tr {
  border-bottom: 2px solid #e2e8f0;
}

.qp-exam-table__th {
  text-align: left;
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 1rem 1.5rem;
  border: none;
  border-bottom: 2px solid #e2e8f0;
}

.qp-exam-table__th--price {
  width: 8rem;
  min-width: 8rem;
}

.qp-exam-table__th--action {
  width: 7rem;
  min-width: 7rem;
  text-align: right;
  padding-right: 1.5rem;
}

.qp-exam-table__body .qp-exam-table__row {
  transition: background-color 0.15s ease;
}

.qp-exam-table__body .qp-exam-table__row:hover {
  background-color: #f8fafc;
}

.qp-exam-table__body .qp-exam-table__row:last-child .qp-exam-table__cell {
  border-bottom: none;
}

.qp-exam-table__cell {
  padding: 1rem 1.5rem;
  border: none;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}

.qp-exam-table__cell--exam {
  min-width: 0;
  max-width: 100%;
}

.qp-exam-table__cell--price {
  color: #0f172a;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.qp-exam-table__cell--action {
  text-align: right;
  padding-right: 1.5rem;
}

.qp-exam-table__name {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.9375rem;
  line-height: 1.4;
}

.qp-exam-table__desc {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.25rem;
  line-height: 1.45;
}

.qp-exam-table__price {
  font-variant-numeric: tabular-nums;
}

/* Buy button – clearly styled, not plain text */
.qp-exam-table__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #ffffff;
  background: #1e3a5f;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.qp-exam-table__btn:hover {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.qp-exam-table__btn:hover {
  cursor: pointer;
}

.qp-exam-table__btn:focus {
  outline: 2px solid #1e3a5f;
  outline-offset: 2px;
}

.qp-exam-table__btn-icon {
  font-size: 1rem;
  width: 1rem;
  height: 1rem;
}

.qp-exam-table__btn.is-loading {
  opacity: 0.8;
  pointer-events: none;
}

/* Purchase exam table: mobile – prevent Buy button from being stripped/cut off */
@media (max-width: 640px) {
  .qp-exam-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .qp-exam-table {
    min-width: 280px;
  }
  .qp-exam-table__cell {
    padding: 0.75rem 1rem;
  }
  .qp-exam-table__th--action,
  .qp-exam-table__cell--action {
    width: auto;
    min-width: 0;
    padding-right: 1rem;
  }
  .qp-exam-table__btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
  .qp-exam-table__btn-icon {
    font-size: 0.875rem;
    width: 0.875rem;
    height: 0.875rem;
  }
}

/* Sleek spinner (used in modal and buttons) */
.qp-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: qp-spin 0.6s linear infinite;
  vertical-align: -0.2em;
  margin-right: 0.35em;
}

@keyframes qp-spin {
  to { transform: rotate(360deg); }
}

.qp-u-hidden {
  display: none !important;
}

.qp-loader-inline {
  display: flex !important;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: #64748b;
  margin: 0 0 0.75rem;
}

.qp-buy-modal-cart-status.qp-msg--error {
  color: #dc2626;
  display: block !important;
  margin-bottom: 0.75rem;
}

.qp-buy-modal-proceed.is-loading {
  pointer-events: none;
  opacity: 0.85;
}

.qp-buy-modal-proceed .qp-spinner {
  margin-right: 0.5rem;
}

.qp-buy-apply-coupon.is-loading,
#qp-buy-apply-coupon.is-loading {
  position: relative;
  color: transparent !important;
}

#qp-buy-apply-coupon.is-loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1rem;
  height: 1rem;
  margin: -0.5rem 0 0 -0.5rem;
  border: 2px solid #64748b;
  border-right-color: transparent;
  border-radius: 50%;
  animation: qp-spin 0.6s linear infinite;
}

/* Buy exam modal (coupon + proceed to checkout) */
.qp-buy-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.qp-buy-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.qp-buy-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.qp-buy-modal-panel {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  max-width: 420px;
  width: 100%;
}

.qp-buy-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.qp-buy-modal-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}

.qp-buy-modal-close {
  padding: 0.25rem;
  border: none;
  background: none;
  cursor: pointer;
  color: #64748b;
}

.qp-buy-modal-close:hover {
  color: #0f172a;
}

.qp-buy-modal-body {
  padding: 1.25rem;
}

.qp-buy-modal-exam {
  margin: 0 0 0.25rem;
  font-weight: 600;
  color: #0f172a;
  font-size: 1rem;
}

.qp-buy-modal-price {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: #64748b;
}

.qp-buy-modal-coupon {
  margin-bottom: 1rem;
}

.qp-buy-modal-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f172a;
}

.qp-buy-modal-coupon-row {
  display: flex;
  gap: 0.5rem;
}

.qp-buy-modal-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9375rem;
}

.qp-buy-modal-coupon-msg {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
}

.qp-buy-modal-coupon-msg.is-visible.qp-msg--success {
  color: #059669;
}

.qp-buy-modal-coupon-msg.is-visible.qp-msg--error {
  color: #dc2626;
}

.qp-buy-modal-proceed {
  width: 100%;
  justify-content: center;
}

/* Thank you / order-received: clean card layout */
.qp-thankyou-message {
  font-size: 1.0625rem;
  margin-bottom: 1.5rem;
}
.qp-thankyou-card {
  background: var(--qp-bg-card);
  border: 1px solid var(--qp-border);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  max-width: 420px;
}
.qp-thankyou-card--error {
  border-color: #fecaca;
  background: #fef2f2;
}
.qp-thankyou-card__message {
  margin: 0 0 1rem;
  color: #0f172a;
}
.qp-thankyou-card__actions {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.qp-thankyou-details {
  margin: 0;
  display: grid;
  gap: 0.75rem 1.5rem;
}
.qp-thankyou-details__row {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}
.qp-thankyou-details__row dt {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--qp-text-muted);
  min-width: 7rem;
}
.qp-thankyou-details__row dd {
  margin: 0;
  font-weight: 600;
  color: #0f172a;
}
.qp-thankyou-status {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
}
.qp-thankyou-status--completed {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}
.qp-thankyou-status--processing {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

/* In-app receipt view (Purchase History → View receipt) */
.qp-receipt-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--qp-text-muted);
  text-decoration: none;
  margin-bottom: 0.75rem;
}
.qp-receipt-back:hover {
  color: #0f172a;
}
.qp-receipt-back .material-symbols-outlined {
  font-size: 1.125rem;
  width: 1.125rem;
  height: 1.125rem;
}
.qp-receipt-card {
  background: var(--qp-bg-card);
  border: 1px solid var(--qp-border);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  max-width: 420px;
  margin-bottom: 1.5rem;
}
.qp-receipt-actions {
  margin: 0;
}

/* Quiz runner (question + feedback + timer) */
.qp-quiz-runner {
  max-width: 720px;
  margin: 0 auto;
}
.qp-quiz-runner__header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--qp-border);
}
.qp-quiz-runner__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e3a5f;
  margin: 0 0 0.25rem;
}
.qp-quiz-runner__progress {
  font-size: 0.875rem;
  color: var(--qp-text-muted);
  margin: 0 0 0.5rem;
}
.qp-quiz-runner__timer {
  font-size: 0.875rem;
  color: var(--qp-text-muted);
}
.qp-quiz-runner__timer-value {
  font-weight: 600;
  color: #0f172a;
}
.qp-quiz-runner__body {
  margin-bottom: 1.5rem;
}
.qp-quiz-runner__question-prompt {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.qp-quiz-runner__options {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}
.qp-quiz-runner__option {
  margin: 0;
  border: 1px solid var(--qp-border);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.qp-quiz-runner__option-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  margin: 0;
}
.qp-quiz-runner__option-label input {
  margin-top: 0.25rem;
}
.qp-quiz-runner__option-label:hover {
  background: #f8fafc;
}
.qp-quiz-runner__option--correct {
  border-color: #059669;
  background: rgba(5, 150, 105, 0.08);
}
.qp-quiz-runner__option--incorrect {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
}
.qp-quiz-runner__result {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}
.qp-quiz-runner__result--correct {
  background: rgba(5, 150, 105, 0.12);
  border: 1px solid #059669;
}
.qp-quiz-runner__result--incorrect {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid #dc2626;
}
.qp-quiz-runner__result-text {
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.qp-quiz-runner__result--correct .qp-quiz-runner__result-text { color: #059669; }
.qp-quiz-runner__result--incorrect .qp-quiz-runner__result-text { color: #dc2626; }
.qp-quiz-runner__feedback-text {
  margin: 0;
  font-size: 0.9375rem;
  color: #334155;
}
.qp-quiz-runner__continue-wrap {
  margin: 0;
}
.qp-quiz-runner__submit-wrap {
  margin: 0;
}
.qp-quiz-runner__progress-bar {
  height: 6px;
  background: var(--qp-border);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
}
.qp-quiz-runner__progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #059669, #0d9488);
  transition: width 0.3s ease;
}

/* Quiz submit button loader */
.qp-btn__spinner {
  display: none;
  width: 1.25em;
  height: 1.25em;
  margin-left: 0.5em;
  vertical-align: middle;
}
.qp-btn__spinner.is-visible {
  display: inline-block;
  animation: qp-spin 0.7s linear infinite;
}
.qp-btn--loading .qp-btn__text { opacity: 0.85; }
.qp-btn--loading .qp-btn__spinner { display: inline-block !important; animation: qp-spin 0.7s linear infinite; }
.qp-btn--loading .qp-btn__spinner.is-visible { display: inline-block !important; }

/* Quiz content transition (no full-page reload) */
.qp-app-content.qp-quiz-transition-next .qp-quiz-runner,
.qp-app-content.qp-quiz-transition-next .qp-quiz-summary,
.qp-app-content.qp-quiz-transition-next .qp-page {
  animation: qp-quiz-fade-in 0.3s ease forwards;
}
.qp-app-content.qp-quiz-submitting {
  pointer-events: none;
}
.qp-app-content.qp-quiz-submitting .qp-quiz-runner__body {
  opacity: 0.92;
  transition: opacity 0.2s ease;
}
@keyframes qp-quiz-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Feedback step subtle entrance */
.qp-quiz-runner__feedback-step {
  animation: qp-feedback-in 0.35s ease-out forwards;
}
.qp-quiz-runner__result {
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
@keyframes qp-feedback-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Quiz summary (after completion) */
.qp-quiz-summary__header {
  margin-bottom: 1.5rem;
}
.qp-quiz-summary__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e3a5f;
  margin: 0;
}
.qp-quiz-summary__score-card {
  background: var(--qp-bg-card);
  border: 1px solid var(--qp-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.qp-quiz-summary__score-label {
  font-size: 0.8125rem;
  color: var(--qp-text-muted);
  margin: 0 0 0.25rem;
}
.qp-quiz-summary__score-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
}
.qp-quiz-summary__score-value--pass { color: #059669; }
.qp-quiz-summary__score-value--fail { color: #dc2626; }
.qp-quiz-summary__score-detail {
  font-size: 0.9375rem;
  color: #64748b;
  margin: 0.5rem 0 0;
}
.qp-quiz-summary__divider {
  border: none;
  border-top: 1px solid var(--qp-border);
  margin: 1rem 0;
}
.qp-quiz-summary__time {
  margin: 0;
  font-size: 0.9375rem;
  color: #334155;
}
.qp-quiz-summary__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 640px) {
  .qp-quiz-summary__grid {
    grid-template-columns: 1fr;
  }
}

/* Quiz runner: mobile-friendly touch targets and spacing */
@media (max-width: 640px) {
  .qp-quiz-runner {
    max-width: 100%;
    padding: 0;
  }
  .qp-quiz-runner__header {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
  }
  .qp-quiz-runner__title {
    font-size: 1rem;
  }
  .qp-quiz-runner__progress,
  .qp-quiz-runner__timer {
    font-size: 0.8125rem;
  }
  .qp-quiz-runner__body {
    margin-bottom: 1.25rem;
  }
  .qp-quiz-runner__question-prompt {
    font-size: 1rem;
    margin-bottom: 1rem;
    line-height: 1.5;
  }
  .qp-quiz-runner__options {
    margin-bottom: 1.25rem;
  }
  .qp-quiz-runner__option {
    margin-bottom: 0.5rem;
  }
  .qp-quiz-runner__option-label {
    min-height: 48px;
    padding: 1rem 1rem;
    gap: 0.875rem;
    -webkit-tap-highlight-color: transparent;
  }
  .qp-quiz-runner__option-label input {
    margin-top: 0.2rem;
  }
  .qp-quiz-runner__result {
    padding: 1rem;
    margin-bottom: 1.25rem;
  }
  .qp-quiz-runner__feedback-text {
    font-size: 0.875rem;
  }
  .qp-quiz-runner__submit-wrap .qp-btn,
  .qp-quiz-runner__continue-wrap .qp-btn {
    min-height: 48px;
    padding: 0.75rem 1.25rem;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .qp-quiz-runner__option-label {
    min-height: 52px;
    padding: 1rem 1.125rem;
  }
  .qp-quiz-runner__question-prompt {
    font-size: 0.9375rem;
  }
}
.qp-quiz-summary__col-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e3a5f;
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  background: #1e3a5f;
  color: #fff;
  border-radius: 8px 8px 0 0;
}
.qp-quiz-summary__competency-list,
.qp-quiz-summary__question-grid {
  background: #fff;
  border: 1px solid var(--qp-border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 1rem;
  margin: 0;
  list-style: none;
}
.qp-quiz-summary__competency-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9375rem;
}
.qp-quiz-summary__competency-item:last-child {
  border-bottom: none;
}
.qp-quiz-summary__competency-name {
  flex: 1 1 100%;
}
.qp-quiz-summary__competency-pct {
  font-weight: 700;
  color: #dc2626;
}
.qp-quiz-summary__competency-count {
  font-size: 0.8125rem;
  color: #64748b;
}
.qp-quiz-summary__question-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.qp-quiz-summary__q-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  color: #0f172a;
  border: 1px solid var(--qp-border);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
button.qp-quiz-summary__q-num {
  padding: 0;
  font: inherit;
}
.qp-quiz-summary__q-num:hover {
  background: #f1f5f9;
}
.qp-quiz-summary__q-num--correct {
  background: rgba(5, 150, 105, 0.15);
  border-color: #059669;
  color: #059669;
}
.qp-quiz-summary__q-num--incorrect {
  background: rgba(220, 38, 38, 0.1);
  border-color: #dc2626;
  color: #dc2626;
}
.qp-quiz-summary__actions {
  margin: 0;
}
.qp-quiz-review__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--qp-text-muted);
  text-decoration: none;
  margin-bottom: 1rem;
}
.qp-quiz-review__back:hover {
  color: #0f172a;
}
.qp-form-stack .qp-form-group {
  margin-bottom: 1rem;
}

/* Demo & form selects – match theme inputs */
.qp-demo-form select,
.qp-form-control,
.qp-app-content .qp-form-group select {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0.625rem 2rem 0.625rem 0.75rem;
  font-family: var(--qp-font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--qp-text);
  background-color: var(--qp-bg-card);
  border: 1px solid var(--qp-border-input);
  border-radius: var(--qp-radius);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  cursor: pointer;
  transition: border-color var(--qp-transition), box-shadow var(--qp-transition);
}
.qp-demo-form select:focus,
.qp-form-control:focus,
.qp-app-content .qp-form-group select:focus {
  outline: none;
  border-color: var(--qp-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.qp-demo-form select:hover,
.qp-form-control:hover,
.qp-app-content .qp-form-group select:hover {
  border-color: var(--qp-text-muted);
}

/* Demo picker: on large screens only – centered, smaller dropdowns, state + quiz on one line */
@media (min-width: 769px) {
  .qp-demo-picker {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    margin: 0 auto;
  }

  .qp-demo-picker .qp-demo-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 0;
  }

  .qp-demo-picker .qp-form-stack .qp-form-group {
    margin-bottom: 0;
  }

  .qp-demo-picker .qp-form-control,
  .qp-demo-picker select {
    width: auto;
    min-width: 200px;
    max-width: 240px;
  }

  /* When quiz dropdown is shown, hide "Show quizzes" so row is: State | Quiz | Start demo */
  .qp-demo-picker:has(.qp-demo-start-form) .qp-demo-state-form__submit {
    display: none;
  }
}

.qp-form-label-invisible {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Checkout inside app (same left sidebar + right pane) */
body.qp-checkout-in-app .qp-app-content .woocommerce {
  padding: 0;
  width: 100%;
}

/* Checkout: two columns – order summary left, payment + button right; full width on large screens */
body.qp-checkout-in-app .qp-app-content .qp-checkout-review,
body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-review-order {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  width: 100%;
}

body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-review-order-table {
  width: 100%;
  margin: 0;
  border: 1px solid var(--qp-border);
  border-radius: var(--qp-radius-lg);
  overflow: hidden;
  box-shadow: var(--qp-shadow);
  background: var(--qp-bg-card);
}

body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-review-order-table th,
body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-review-order-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--qp-border);
  color: var(--qp-text);
  font-size: 0.9375rem;
}

body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-review-order-table thead th {
  background: var(--qp-bg);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--qp-text-muted);
}

body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-review-order-table .order-total th,
body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-review-order-table .order-total td {
  font-weight: 700;
  font-size: 1rem;
  border-bottom: none;
}

/* Payment column (right) */
body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-payment {
  background: var(--qp-bg-card);
  border: 1px solid var(--qp-border);
  border-radius: var(--qp-radius-lg);
  padding: 1.25rem;
  margin: 0;
  box-shadow: var(--qp-shadow);
}

body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-payment .wc_payment_methods {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  border: none;
}

body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-payment .wc_payment_methods li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--qp-border);
  margin: 0;
}

body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-payment .wc_payment_methods li:last-of-type {
  border-bottom: none;
}

body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-payment label {
  cursor: pointer;
  font-weight: 500;
  color: var(--qp-text);
}

body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-payment .payment_box {
  background: var(--qp-bg);
  border-radius: var(--qp-radius);
  padding: 0.75rem 1rem;
  margin: 0.5rem 0 0 1.5rem;
  font-size: 0.875rem;
  color: var(--qp-text);
}

/* Place order → Complete Exam Purchase button (theme primary) */
body.qp-checkout-in-app .qp-app-content #place_order,
body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-payment .button {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--qp-radius);
  cursor: pointer;
  background: var(--qp-primary) !important;
  color: #fff !important;
  border: none !important;
  font-family: var(--qp-font-sans);
  transition: background var(--qp-transition), box-shadow var(--qp-transition);
  margin-top: 1rem;
}

body.qp-checkout-in-app .qp-app-content #place_order:hover,
body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-payment .button:hover {
  background: var(--qp-primary-dark) !important;
  color: #fff !important;
  box-shadow: var(--qp-shadow-lg);
}

body.qp-checkout-in-app .qp-app-content .form-row.place-order {
  margin: 0;
  padding: 0;
}

/* Checkout heading */
body.qp-checkout-in-app .qp-app-content .qp-checkout-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--qp-text);
  margin: 0 0 1rem;
}

/* Responsive: stack on small screens */
@media (max-width: 768px) {
  body.qp-checkout-in-app .qp-app-content .qp-checkout-review,
  body.qp-checkout-in-app .qp-app-content .woocommerce-checkout-review-order {
    grid-template-columns: 1fr;
  }
}

/* My Exams list (purchased exams) */
.qp-my-exams-list {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.qp-my-exams-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border-bottom: 1px solid #e2e8f0;
}

.qp-my-exams-item:last-child {
  border-bottom: none;
}

.qp-my-exams-item__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  flex-wrap: nowrap;
}

.qp-my-exams-item__info {
  min-width: 0;
  flex: 1;
}

.qp-my-exams-item__name {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.9375rem;
}

.qp-my-exams-item__desc {
  display: block;
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.125rem;
}

.qp-my-exams-item__action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

.qp-my-exams-item__badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: #059669;
  background: rgba(5, 150, 105, 0.12);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.qp-my-exams-item__badge--expired {
  color: #b91c1c;
  background: rgba(185, 28, 28, 0.12);
}

.qp-my-exams-item__expiry {
  display: block;
  font-size: 0.75rem;
  color: var(--qp-text-muted);
  margin-top: 0.25rem;
}

.qp-my-exams-item--expired .qp-my-exams-item__expiry {
  color: #b91c1c;
}

.qp-my-exams-item__attempts-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.qp-my-exams-item__attempts-btn .qp-btn-icon {
  font-size: 1rem;
  width: 1rem;
  height: 1rem;
}

.qp-my-exams-item__attempts-count {
  font-size: 0.8125rem;
  color: var(--qp-text-muted);
  font-weight: 400;
}

/* Slide-down attempts panel (below the exam row) */
.qp-my-exams-item__attempts-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

.qp-my-exams-item__attempts-panel.is-open {
  max-height: 420px;
}

.qp-my-exams-item__attempts-list {
  padding: 0.75rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 380px;
  overflow-y: auto;
}

.qp-my-exams-item__attempt-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--qp-radius);
  font-size: 0.875rem;
}

.qp-my-exams-item__attempt-date {
  flex: 1;
  min-width: 0;
  color: var(--qp-text);
}

.qp-my-exams-item__attempt-score {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--qp-text);
  min-width: 4rem;
  text-align: right;
}

.qp-my-exams-item__attempt-status {
  font-weight: 500;
  color: var(--qp-primary);
  font-size: 0.8125rem;
}

.qp-my-exams-item__attempt-row--in-progress .qp-my-exams-item__attempt-score {
  color: var(--qp-primary);
}

.qp-my-exams-item__attempt-view {
  flex-shrink: 0;
}

/* Resume button in attempts list – distinct color */
.qp-my-exams-item__attempt-view--resume {
  color: var(--qp-primary);
  font-weight: 500;
}
.qp-my-exams-item__attempt-view--resume:hover {
  color: var(--qp-primary-dark);
  background: rgba(13, 148, 136, 0.08);
}

.qp-my-exams-item__attempts-empty {
  margin: 0;
  padding: 0.75rem;
  font-size: 0.875rem;
  color: var(--qp-text-muted);
  text-align: center;
}

/* Purchase History table */
.qp-history-table-wrap {
  margin-top: 0.5rem;
  margin-bottom: 2rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.qp-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.qp-history-table__head {
  background: #f8fafc;
}
.qp-history-table__th {
  text-align: left;
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid #e2e8f0;
}
.qp-history-table__body .qp-history-table__row {
  border-bottom: 1px solid #e2e8f0;
}
.qp-history-table__body .qp-history-table__row:last-child {
  border-bottom: none;
}
.qp-history-table__cell {
  padding: 1rem 1.25rem;
  vertical-align: middle;
}
.qp-history-table__cell--total {
  font-weight: 600;
  color: #0f172a;
}
.qp-history-table__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
@media (max-width: 640px) {
  .qp-history-table-wrap {
    overflow-x: auto;
  }
  .qp-history-table {
    min-width: 520px;
  }
  .qp-history-table__cell {
    padding: 0.75rem 1rem;
  }
}

/* Settings modal */
.qp-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--qp-transition), visibility var(--qp-transition);
}

.qp-settings-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.qp-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.qp-settings-panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  background: var(--qp-bg-card);
  border-radius: var(--qp-radius-lg);
  box-shadow: 0 24px 48px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.qp-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--qp-border);
}

.qp-settings-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--qp-text);
}

.qp-settings-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: none;
  border-radius: var(--qp-radius);
  cursor: pointer;
  color: var(--qp-text-muted);
  transition: background var(--qp-transition), color var(--qp-transition);
}

.qp-settings-close:hover {
  background: var(--qp-border);
  color: var(--qp-text);
}

.qp-settings-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.qp-settings-section {
  margin-bottom: 1.5rem;
}

.qp-settings-section:last-child {
  margin-bottom: 0;
}

.qp-settings-section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--qp-text);
  margin: 0 0 0.75rem;
}

.qp-settings-avatar-zone {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.qp-settings-avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--qp-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.qp-settings-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qp-settings-avatar-initials {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--qp-dark-blue);
}

.qp-settings-avatar-actions label {
  cursor: pointer;
  margin: 0;
}

.qp-btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.qp-settings-form .qp-form-group {
  margin-bottom: 1rem;
}

/* Settings form: first/last/email and password fields on one line on large screens */
@media (min-width: 769px) {
  .qp-settings-form-row {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .qp-settings-form-row .qp-form-group {
    margin-bottom: 0;
  }

  .qp-settings-form-row--profile {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .qp-settings-form-row--password {
    grid-template-columns: 1fr 1fr 1fr auto;
    align-items: end;
  }

  .qp-settings-form-row__submit .qp-btn {
    white-space: nowrap;
  }
}

.qp-settings-form .qp-form-group input {
  border: 1px solid var(--qp-border-input);
  border-radius: var(--qp-radius);
  padding: 0.625rem 0.75rem;
  background: var(--qp-bg-card);
}

.qp-settings-form .qp-form-group input:focus {
  border-color: var(--qp-dark-blue);
  box-shadow: 0 0 0 2px rgba(30, 58, 95, 0.2);
}

.qp-settings-form .qp-message {
  margin-bottom: 0.75rem;
}

.qp-settings-form .qp-btn {
  margin-top: 0.25rem;
}

.qp-field-error {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: #b91c1c;
}
.qp-form-group.qp-has-error input {
  border-color: #f87171;
  box-shadow: 0 0 0 1px #fecaca;
}

.qp-field-hint {
  display: block;
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
}
.qp-field-hint--error {
  color: #b91c1c;
}
.qp-field-hint--ok {
  color: #15803d;
}

.qp-app-content {
  flex: 1;
  padding: 1.5rem;
  overflow-auto;
}

.qp-app-content.qp-loading {
  pointer-events: none;
}

.qp-content-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 1rem;
  color: var(--qp-text-muted);
}
.qp-content-loading .qp-spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
}
.qp-content-loading__text {
  margin: 0;
  font-size: 0.9375rem;
}

.qp-empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--qp-text-muted);
}

.qp-empty-state-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.qp-text-muted {
  color: var(--qp-text-muted);
  font-size: 0.9375rem;
}

.qp-dashboard-section {
  margin-bottom: 1.5rem;
}

.qp-dashboard-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--qp-text);
  margin: 0 0 0.75rem;
}

.qp-dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.qp-card {
  background: var(--qp-bg-card);
  border-radius: var(--qp-radius-lg);
  padding: 1.25rem;
  box-shadow: var(--qp-shadow);
  border: 1px solid var(--qp-border);
  transition: transform var(--qp-transition), box-shadow var(--qp-transition);
}

.qp-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--qp-shadow-lg);
}

.qp-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--qp-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.qp-card-icon--teal { background: rgba(13, 148, 136, 0.12); color: var(--qp-primary); }
.qp-card-icon--blue { background: rgba(59, 130, 246, 0.12); color: #2563eb; }
.qp-card-icon--purple { background: rgba(139, 92, 246, 0.12); color: #6d28d9; }
.qp-card-icon--amber { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.qp-card-icon--green { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.qp-card-icon--rose { background: rgba(244, 63, 94, 0.12); color: #e11d48; }

.qp-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  color: var(--qp-text);
}

.qp-card p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--qp-text-muted);
  line-height: 1.5;
}

/* Default header (non-dashboard) */
.qp-site-header .qp-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--qp-bg-card);
  border-bottom: 1px solid var(--qp-border);
}

.qp-site-header .qp-logo-text {
  font-size: 1.25rem;
}

.qp-dashboard-nav a {
  padding: 0.5rem 1rem;
  border-radius: var(--qp-radius);
  font-size: 0.9375rem;
  font-weight: 500;
}

.qp-dashboard-nav .qp-logout {
  color: var(--qp-text-muted);
}

.qp-dashboard-nav .qp-logout:hover {
  color: #b91c1c;
  background: #fef2f2;
}

.qp-content-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

.qp-entry-title {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.qp-site-footer {
  margin-top: auto;
  padding: 1rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--qp-border);
  color: var(--qp-text-muted);
  font-size: 0.875rem;
}

.qp-footer-text {
  margin: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .qp-sidebar {
    width: 72px;
    min-width: 72px;
    padding: 0.5rem 0;
  }

  .qp-sidebar-header {
    padding: 1rem 0.5rem;
    text-align: center;
  }

  .qp-sidebar-header .qp-sidebar-logo .qp-app-logo-img,
  .qp-sidebar-header .qp-sidebar-logo img {
    max-height: 65px;
    margin: 0 auto;
  }

  .qp-sidebar-header .qp-logo-text {
    font-size: 0;
  }

  .qp-sidebar-header .qp-logo-text::first-letter {
    font-size: 1.25rem;
  }

  .qp-sidebar-nav a {
    justify-content: center;
    padding: 0.75rem;
    margin: 0 0.375rem;
  }

  .qp-sidebar-nav a.qp-nav-active {
    margin-left: 0.375rem;
    padding-left: 0.75rem;
    border-left-width: 2px;
  }

  .qp-sidebar-nav .qp-nav-label {
    display: none;
  }

  .qp-sidebar-footer {
    padding: 0.75rem 0.5rem;
  }

  .qp-sidebar-upgrade .qp-nav-label {
    display: none;
  }

  .qp-sidebar-upgrade {
    padding: 0.75rem;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .qp-auth-wrap {
    flex-direction: column;
  }

  .qp-auth-visual {
    min-height: 200px;
    padding: 1.5rem;
  }

  .qp-auth-visual-content {
    padding: 1rem 0;
  }

  .qp-auth-visual-content h2 {
    font-size: 1.35rem;
  }

  /* On mobile: hide copyright in left panel, show in footer below form */
  .qp-auth-visual-copy {
    display: none;
  }

  .qp-auth-page-footer {
    display: block;
  }

  .qp-auth-form-panel {
    padding: 1.5rem 1.25rem;
    box-shadow: none;
  }

  .qp-auth-form-brand {
    top: 1rem;
    left: 1.25rem;
  }

  /* Dashboard: hide sidebar, show hamburger + offcanvas */
  .qp-app .qp-sidebar {
    display: none;
  }

  .qp-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: -0.5rem 0 -0.5rem -0.5rem;
    background: none;
    border: none;
    border-radius: var(--qp-radius);
    cursor: pointer;
    color: var(--qp-text);
    transition: background var(--qp-transition);
  }

  .qp-hamburger:hover {
    background: var(--qp-border);
  }

  .qp-hamburger svg {
    width: 24px;
    height: 24px;
  }

  .qp-offcanvas-backdrop {
    display: block;
  }

  .qp-offcanvas-panel {
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
  }

  .qp-app.is-offcanvas-open .qp-offcanvas-backdrop {
    opacity: 1;
    visibility: visible;
  }

  .qp-app.is-offcanvas-open .qp-offcanvas-panel {
    transform: translateX(0);
  }

  .qp-dashboard-cards {
    grid-template-columns: 1fr;
  }

  .qp-app-content {
    padding: 1rem 1rem;
  }

  .qp-content-wrap {
    padding: 1.25rem 1rem;
  }

  .qp-page__header {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
  }

  .qp-page__title {
    font-size: 1.25rem;
  }

  .qp-page__subtitle {
    font-size: 0.875rem;
  }
}

/* Desktop: hamburger always visible so sidebar can be collapsed/expanded */
@media (min-width: 769px) {
  .qp-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: -0.5rem 0 -0.5rem -0.5rem;
    background: none;
    border: none;
    border-radius: var(--qp-radius);
    cursor: pointer;
    color: var(--qp-text);
    transition: background var(--qp-transition);
  }
  .qp-hamburger:hover {
    background: var(--qp-border);
  }
  .qp-hamburger svg {
    width: 24px;
    height: 24px;
  }
  .qp-offcanvas-backdrop,
  .qp-offcanvas-panel {
    display: none;
  }
}

/* Collapsible sidebar: narrow strip with icons + tooltips */
.qp-sidebar-collapsed .qp-sidebar {
  width: 56px;
  min-width: 56px;
  overflow: visible;
  transition: width 0.2s ease, min-width 0.2s ease;
}

.qp-sidebar-collapsed .qp-sidebar-header {
  padding: 1rem 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.qp-sidebar-collapsed .qp-sidebar-logo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.qp-sidebar-collapsed .qp-sidebar-logo .qp-app-logo-img,
.qp-sidebar-collapsed .qp-sidebar-logo img {
  max-height: 28px;
  max-width: 40px;
  object-fit: contain;
}

.qp-sidebar-collapsed .qp-sidebar-header .qp-logo-text {
  display: none;
}

.qp-sidebar-collapsed .qp-sidebar-nav a,
.qp-sidebar-collapsed .qp-sidebar-footer .qp-sidebar-upgrade {
  justify-content: center;
  padding: 0.625rem;
  margin: 0 0.25rem;
  min-height: 44px;
}

.qp-sidebar-collapsed .qp-sidebar-nav a.qp-nav-active {
  margin-left: 0.25rem;
  padding-left: 0.625rem;
  border-left-width: 3px;
}

.qp-sidebar-collapsed .qp-nav-label,
.qp-sidebar-collapsed .qp-sidebar-upgrade .qp-nav-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.qp-sidebar-collapsed .qp-sidebar-nav .material-symbols-outlined,
.qp-sidebar-collapsed .qp-sidebar-upgrade .material-symbols-outlined {
  margin: 0;
  flex-shrink: 0;
}

.qp-sidebar-collapsed .qp-sidebar-footer {
  padding: 0.75rem 0.5rem;
}

.qp-sidebar-collapsed .qp-app-main {
  margin-left: 0;
}

@media (max-width: 480px) {
  .qp-auth-form,
  .qp-auth-view {
    max-width: 100%;
  }

  html {
    font-size: 15px;
  }

  .qp-app-content {
    padding: 0.875rem 0.75rem;
  }

  .qp-content-wrap {
    padding: 1rem 0.75rem;
  }

  .qp-page__title {
    font-size: 1.125rem;
  }

  .qp-quiz-summary__score-card {
    padding: 1.25rem 1rem;
  }

  .qp-quiz-summary__score-value {
    font-size: 1.5rem;
  }

  .qp-quiz-summary__col-title {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
  }

  .qp-my-exams-item__row {
    padding: 0.875rem 1rem;
    flex-wrap: wrap;
  }

  .qp-settings-panel {
    max-width: 100%;
    margin: 0.5rem;
    max-height: 85vh;
  }

  .qp-receipt-card .qp-thankyou-details__row {
    flex-wrap: wrap;
  }
}
