/* Premium Persian RTL landing for PDF question generation. */
.qgen-page { --qgen-ink:#172033; --qgen-muted:#64748b; }
.qgen-hero { isolation:isolate; min-height:250px; box-shadow:0 24px 60px rgb(37 99 235 / 18%); }
.qgen-hero > .relative.z-10 { max-width:650px; }
.qgen-hero h1 { letter-spacing:-.035em; text-wrap:balance; }
.qgen-hero p { max-width:580px; }
.qgen-hero-art { position:absolute; z-index:0; left:4.5%; top:50%; width:min(390px,36%); transform:translateY(-50%) rotate(-2deg); }
.qgen-glow { position:absolute; border-radius:999px; filter:blur(2px); }
.qgen-glow-one { width:230px; height:230px; right:-24px; top:-48px; background:rgb(103 232 249 / 17%); }
.qgen-glow-two { width:170px; height:170px; left:-28px; bottom:-35px; background:rgb(196 181 253 / 20%); }
.qgen-preview-card { position:relative; padding:1.1rem; border:1px solid rgb(255 255 255 / 58%); border-radius:1.35rem; background:linear-gradient(145deg,rgb(255 255 255 / 96%),rgb(239 246 255 / 94%)); color:#1e293b; box-shadow:0 25px 65px rgb(15 23 42 / 25%); transform:perspective(900px) rotateY(5deg); }
.qgen-preview-top { display:flex; gap:.65rem; align-items:center; }
.qgen-preview-pdf { display:flex; align-items:center; justify-content:center; width:42px; height:46px; border-radius:.75rem; background:#fff1f2; color:#e11d48; font-size:1.25rem; }
.qgen-preview-top b { display:block; font-size:.78rem; color:#0f172a; }
.qgen-preview-top small { display:block; margin-top:.15rem; font-size:.64rem; color:#64748b; }
.qgen-ai-chip { margin-right:auto; display:inline-flex; align-items:center; gap:.3rem; border-radius:999px; padding:.3rem .55rem; background:#e0e7ff; color:#4338ca; font-weight:900; font-size:.65rem; }
.qgen-preview-rule { height:1px; background:#e2e8f0; margin:1rem 0 .9rem; }
.qgen-preview-question { font-size:.8rem; line-height:1.8; font-weight:900; margin:0 0 .7rem; color:#172033; }
.qgen-preview-option { display:flex; align-items:center; gap:.6rem; padding:.52rem .6rem; border:1px solid #e2e8f0; border-radius:.65rem; margin-top:.42rem; font-size:.68rem; color:#475569; background:white; }
.qgen-preview-option > i { display:grid; place-items:center; width:22px; height:22px; border-radius:.45rem; background:#f1f5f9; color:#475569; font-style:normal; font-weight:900; }
.qgen-preview-option.is-picked { border-color:#a5b4fc; background:#eef2ff; color:#3730a3; }
.qgen-preview-option.is-picked > i { background:#4f46e5; color:white; }
.qgen-preview-option > b { margin-right:auto; color:#4f46e5; }
.qgen-preview-footer { display:flex; align-items:center; justify-content:space-between; margin-top:.85rem; font-size:.65rem; color:#64748b; }
.qgen-preview-footer i { color:#059669; margin-left:.2rem; }
.qgen-feature-strip { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.75rem; margin:-.25rem 0 .5rem; }
.qgen-feature-strip > div { display:flex; align-items:center; gap:.8rem; padding:.85rem 1rem; border:1px solid #e2e8f0; border-radius:1rem; background:linear-gradient(110deg,#fff,#f8fafc); box-shadow:0 5px 18px rgb(15 23 42 / 3%); }
.qgen-feature-icon { display:flex; align-items:center; justify-content:center; flex:0 0 40px; height:40px; border-radius:.8rem; font-size:1rem; }
.qgen-feature-icon.is-blue { color:#2563eb; background:#dbeafe; }
.qgen-feature-icon.is-violet { color:#7c3aed; background:#ede9fe; }
.qgen-feature-icon.is-emerald { color:#059669; background:#d1fae5; }
.qgen-feature-strip b { display:block; font-size:.8rem; color:#0f172a; }
.qgen-feature-strip small { display:block; margin-top:.15rem; font-size:.68rem; color:#64748b; }
.qgen-content-grid { grid-template-columns:minmax(0,1.4fr) minmax(250px,.75fr); }
.qgen-main-card,.qgen-side-card,.qgen-history { box-shadow:0 12px 35px rgb(15 23 42 / 4%); }
.qgen-main-card { position:relative; overflow:hidden; }
.qgen-main-card::before { content:""; position:absolute; height:4px; top:0; right:0; left:0; background:linear-gradient(90deg,#06b6d4,#6366f1,#8b5cf6); }
#pdf-dropzone { position:relative; transition:border-color .2s ease,background-color .2s ease,box-shadow .2s ease,transform .2s ease; background:radial-gradient(circle at 50% 0%,#fff 0,#f8fafc 75%); }
#pdf-dropzone:hover { transform:translateY(-1px); }
#pdf-dropzone.is-dragover,#pdf-dropzone:focus-within { border-color:#2563eb; background:#eff6ff; box-shadow:0 0 0 4px rgb(37 99 235 / 10%); }
#pdf-dropzone.has-file { border-color:#86efac; background:linear-gradient(145deg,#f0fdf4,#eff6ff); }
#pdf-file-name { overflow-wrap:anywhere; }
#pdf-file-feedback { display:block; margin-top:.5rem; font-size:.75rem; line-height:1.7; }
#pdf-file-feedback.is-error { color:#be123c; }
#pdf-file-feedback.is-success { color:#047857; }
.qgen-aside ol li { position:relative; }
.qgen-aside ol li:not(:last-child)::after { content:""; position:absolute; right:15px; top:37px; height:calc(100% - 16px); border-right:1px dashed #cbd5e1; }
.qgen-side-card { background:linear-gradient(145deg,#fff,#f8fafc); }
.qgen-history table tbody tr { transition:background-color .15s ease; }
.qgen-history table tbody tr:hover { background:#f8fafc; }
@media (max-width:1023px) {
  .qgen-content-grid { grid-template-columns:minmax(0,1fr); }
  .qgen-hero-art { left:3%; width:min(330px,36%); }
}
@media (max-width:900px) { .qgen-hero-art { display:none; } }
@media (max-width:700px) {
  .qgen-hero { min-height:0; padding-bottom:2rem; }
  .qgen-hero-art { display:none; }
  .qgen-feature-strip { grid-template-columns:minmax(0,1fr); gap:.5rem; }
  .qgen-feature-strip > div { padding:.7rem .85rem; }
  .qgen-main-card { padding:1.15rem; }
}
@media (prefers-reduced-motion:reduce) {
  #pdf-dropzone,.qgen-history table tbody tr { transition:none; }
  #pdf-dropzone:hover { transform:none; }
}

/* Final visual refinement: clearer hierarchy, accessible focus, and polished upload feedback. */
.qgen-page { padding-bottom: 1.5rem; color: var(--qgen-ink); }
.qgen-hero { min-height: 285px; border: 1px solid rgb(255 255 255 / 28%); background-size: 140% 140%; animation: qgen-hero-shift 16s ease-in-out infinite alternate; }
.qgen-hero::after { content:""; position:absolute; inset:0; z-index:-1; pointer-events:none; background:linear-gradient(110deg,transparent 35%,rgb(255 255 255 / 7%) 52%,transparent 70%); }
.qgen-hero h1 { max-width: 620px; font-size: clamp(1.7rem, 3vw, 2.45rem); line-height: 1.45; }
.qgen-hero p { color: rgb(239 246 255 / 94%); }
.qgen-preview-card { backdrop-filter: blur(12px); }
.qgen-feature-strip { margin-top: .25rem; margin-bottom: .75rem; }
.qgen-feature-strip > div { min-height: 76px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.qgen-feature-strip > div:hover { transform: translateY(-2px); border-color: #c7d2fe; box-shadow: 0 12px 24px rgb(37 99 235 / 7%); }
.qgen-main-card,.qgen-side-card,.qgen-history { border-color: #e4eaf3; box-shadow: 0 16px 42px rgb(15 23 42 / 5%); }
.qgen-main-card { padding: clamp(1.1rem, 2.4vw, 2rem); }
.qgen-main-card > div:first-child h2 { letter-spacing: -.02em; }
#pdf-dropzone { min-height: 205px; border-radius: 1.35rem; border-color: #cbd5e1; }
#pdf-dropzone > span:first-child { width: 66px; height: 66px; border-radius: 1.1rem; box-shadow: 0 8px 24px rgb(15 23 42 / 7%); }
#pdf-dropzone > span:nth-child(2) { font-size: .95rem; }
#pdf-dropzone > span:nth-child(3) { margin-top: .4rem; }
#pdf-dropzone.has-file > span:first-child { color: #059669; background: #ecfdf5; }
.qgen-page select:focus-visible,.qgen-page button:focus-visible,.qgen-page a:focus-visible,#pdf-dropzone:focus-within { outline: 3px solid rgb(59 130 246 / 35%); outline-offset: 3px; }
.qgen-page select { min-height: 48px; }
.qgen-page button[type="submit"],.qgen-page a[href*="login"] { min-height: 48px; box-shadow: 0 8px 18px rgb(29 78 216 / 15%); }
.qgen-page button[type="submit"]:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 12px 22px rgb(29 78 216 / 22%); }
.qgen-page button[type="submit"] { transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease; }
.qgen-aside .qgen-side-card { padding: 1.4rem; }
.qgen-aside .qgen-side-card h2 { font-size: 1rem; }
.qgen-history thead th { white-space: nowrap; }
.qgen-history tbody td { vertical-align: middle; }
@keyframes qgen-hero-shift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@media (max-width: 900px) {
  .qgen-hero { min-height: 0; }
  .qgen-hero-art { display: none; }
  .qgen-hero > .relative.z-10 { max-width: 100%; }
}
@media (max-width: 700px) {
  .qgen-page { padding-bottom: .5rem; }
  .qgen-hero { border-radius: 1.35rem; }
  .qgen-hero h1 { font-size: 1.65rem; }
  .qgen-main-card { padding: 1.05rem; }
  #pdf-dropzone { min-height: 185px; padding: 1.4rem 1rem; }
  .qgen-feature-strip > div { min-height: 66px; }
}
@media (prefers-reduced-motion: reduce) {
  .qgen-hero { animation: none; }
  .qgen-feature-strip > div,.qgen-page button[type="submit"] { transition: none; }
  .qgen-feature-strip > div:hover,.qgen-page button[type="submit"]:hover { transform: none; }
}

/* Contrast safety net: the checked-in local utility build does not include every
   arbitrary gradient utility used by these views, so define the hero directly. */
.qgen-page .qgen-hero {
  background: linear-gradient(118deg, #312e81 0%, #1d4ed8 52%, #0891b2 100%) !important;
  color: #fff;
}
.qgen-page .qgen-hero > .relative.z-10,
.qgen-page .qgen-hero > .relative.z-10 h1,
.qgen-page .qgen-hero > .relative.z-10 p,
.qgen-page .qgen-hero > .relative.z-10 .rounded-full {
  color: #fff !important;
}
.qgen-page .qgen-hero > .relative.z-10 p { color: #eff6ff !important; }
.qgen-page .qgen-hero > .relative.z-10 .rounded-full {
  background: rgb(255 255 255 / 14%);
  border: 1px solid rgb(255 255 255 / 25%);
}
.qgen-page .qgen-hero .qgen-preview-card,
.qgen-page .qgen-hero .qgen-preview-card * { color: #1e293b; }
.qgen-page .qgen-hero .qgen-preview-top b { color: #0f172a; }
.qgen-page .qgen-hero .qgen-preview-top small,
.qgen-page .qgen-hero .qgen-preview-footer { color: #64748b; }
.qgen-page .qgen-hero .qgen-ai-chip { color: #4338ca !important; background: #e0e7ff; }
.qgen-page .qgen-hero .qgen-preview-option.is-picked { color: #3730a3; }
.qgen-page .qgen-hero .qgen-preview-option.is-picked > i,
.qgen-page .qgen-hero .qgen-preview-option.is-picked > b { color: #fff; }
.qgen-page .qgen-hero .qgen-glow-one { background: rgb(103 232 249 / 24%); }
.qgen-page .qgen-hero .qgen-glow-two { background: rgb(196 181 253 / 24%); }
.qgen-page .qgen-hero > .pointer-events-none { pointer-events: none; }

/* Keep foreground and surface colors explicit on the PDF workflow. */
.qgen-page .qgen-main-card,
.qgen-page .qgen-side-card,
.qgen-page .qgen-history { color: #1e293b; background-color: #fff; }
.qgen-page .qgen-main-card h2,
.qgen-page .qgen-side-card h2,
.qgen-page .qgen-history h2 { color: #0f172a; }
.qgen-page label:not(#pdf-dropzone),
.qgen-page .qgen-history th { color: #334155; }
.qgen-page #pdf-dropzone { color: #334155; }
.qgen-page #pdf-dropzone > span:nth-child(2) { color: #1e293b; }
.qgen-page #pdf-dropzone > span:nth-child(3) { color: #64748b; }
.qgen-page .qgen-history tbody td { color: #334155; }


/* Teacher-specific generation instructions */
#custom_instructions {
  min-height: 150px;
  overflow-wrap: anywhere;
}
#custom_instructions:focus {
  outline: none;
}
.qgen-aside [aria-labelledby="custom-instructions-heading"] {
  border-color: #bfdbfe;
  background: linear-gradient(150deg, #ffffff 0%, #f8fbff 100%);
}
@media (min-width: 1024px) {
  .qgen-aside [aria-labelledby="custom-instructions-heading"] {
    position: sticky;
    top: 7rem;
    align-self: start;
  }
}
