/* LabStudy UI/UX — responsive presentation layer only
   Palette: deep green, green, white, off-white.
   Does not alter routes, forms, payment logic, or application behavior. */

:root {
  --ls-green: #087443;
  --ls-green-dark: #064d30;
  --ls-green-deep: #073b27;
  --ls-green-soft: #e9f4ed;
  --ls-ink: #17251d;
  --ls-muted: #68786e;
  --ls-line: #e1e9e3;
  --ls-bg: #f5f8f5;
  --ls-white: #fff;
  --ls-radius: 16px;
  --ls-shadow: 0 8px 28px rgba(9, 49, 29, .07);
  --ls-focus: 0 0 0 3px rgba(8, 116, 67, .16);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { color: var(--ls-ink); }
img, video, canvas, iframe { max-width: 100%; }
img { height: auto; }
button, input, select, textarea { max-width: 100%; }
button, input, select, textarea { accent-color: var(--ls-green); }
:focus-visible { outline: 0; box-shadow: var(--ls-focus); }
::selection { background: #cce8d6; color: var(--ls-green-deep); }

/* Shared page rhythm */
.ls-site main, .ls-site .page, .ls-site .wrap,
.ls-site .container, .ls-admin main, .ls-admin .container {
  min-width: 0;
}
.ls-site .page { background: var(--ls-bg); }
.ls-site .page > .wrap { padding-top: 30px; padding-bottom: 52px; }
.ls-site .page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 20px; }
.ls-site .breadcrumb, .breadcrumb { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.ls-site .detail, .ls-site .item-card, .ls-site .browse-card,
.ls-site .panel, .ls-site .card, .ls-site .box {
  min-width: 0;
}
.ls-site .detail, .ls-site .panel, .ls-site .box {
  border: 1px solid var(--ls-line);
  border-radius: var(--ls-radius);
  box-shadow: 0 3px 14px rgba(10, 44, 25, .035);
}
.ls-site .detail { background: #fff; }
.ls-site a { text-underline-offset: 3px; }
.ls-site a:hover { color: var(--ls-green); }

/* Frontend header and navigation */
.ls-site header {
  min-height: 76px;
  height: auto;
  padding: 10px 0;
  background: rgba(249, 251, 249, .96);
  border-bottom: 1px solid var(--ls-line);
  backdrop-filter: blur(12px);
}
.ls-site header > .wrap { width: min(1240px, calc(100% - 32px)); }
.ls-site .nav {
  min-height: 56px;
  height: auto;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid var(--ls-line);
  border-radius: 15px;
  box-shadow: 0 4px 18px rgba(15, 54, 31, .06);
}
.ls-site .brand { flex: 0 0 auto; color: var(--ls-green-dark); }
.ls-site .navlinks { gap: clamp(10px, 1.5vw, 22px); }
.ls-site .navlinks a { white-space: nowrap; }
.ls-site .navright { min-width: 0; gap: 8px; }
.ls-site .search, .ls-site input[type="search"] {
  border: 1px solid var(--ls-line);
  background: #f3f7f4;
}
.ls-site .ls-back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #cbdccf;
  border-radius: 10px;
  background: #fff;
  color: var(--ls-green-dark);
  font-weight: 700;
  cursor: pointer;
}
.ls-site .ls-back-button:hover { background: var(--ls-green-soft); }

/* Buttons */
.ls-site button, .ls-site .btn, .ls-site .button,
.ls-admin button, .ls-admin .btn, .ls-admin .button {
  transition: background-color .18s ease, border-color .18s ease,
              color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.ls-site .signup, .ls-site .btn-primary, .ls-site button[type="submit"],
.ls-admin .btn-primary, .ls-admin button[type="submit"] {
  background: var(--ls-green);
  border-color: var(--ls-green);
  color: #fff;
}
.ls-site .signup:hover, .ls-site .btn-primary:hover,
.ls-admin .btn-primary:hover { background: var(--ls-green-dark); }
.ls-site .signin, .ls-site .btn-secondary,
.ls-admin .btn-secondary {
  border: 1px solid #b9d2c1;
  color: var(--ls-green-dark);
  background: #fff;
}
.ls-site button:disabled, .ls-admin button:disabled {
  opacity: .58;
  cursor: not-allowed;
  transform: none;
}

/* Inputs and form layouts */
.ls-site input:not([type="checkbox"]):not([type="radio"]),
.ls-site select, .ls-site textarea,
.ls-admin input:not([type="checkbox"]):not([type="radio"]),
.ls-admin select, .ls-admin textarea,
input.ls-input, select.ls-input, textarea.ls-input {
  min-height: 42px;
  width: 100%;
  border: 1px solid #d8e3da;
  border-radius: 10px;
  background: #fff;
  color: var(--ls-ink);
  padding: 10px 12px;
  font: inherit;
}
.ls-site textarea, .ls-admin textarea { min-height: 110px; resize: vertical; }
.ls-site input:focus, .ls-site select:focus, .ls-site textarea:focus,
.ls-admin input:focus, .ls-admin select:focus, .ls-admin textarea:focus {
  border-color: var(--ls-green);
  outline: 0;
  box-shadow: var(--ls-focus);
}
.ls-site label, .ls-admin label { display: inline-block; margin-bottom: 6px; font-weight: 650; }
.ls-site form, .ls-admin form { min-width: 0; }
.ls-site fieldset, .ls-admin fieldset {
  min-width: 0;
  border: 1px solid var(--ls-line);
  border-radius: 12px;
  padding: 16px;
}
.ls-site input[type="checkbox"], .ls-site input[type="radio"],
.ls-admin input[type="checkbox"], .ls-admin input[type="radio"] {
  width: 18px; height: 18px; vertical-align: middle;
}
.ls-site .form-grid, .ls-admin .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.ls-site .form-group, .ls-admin .form-group { min-width: 0; }

/* Cards, lists, tables */
.ls-site .item-card, .ls-site .browse-card,
.ls-admin .stat-card, .ls-admin .admin-card,
.ls-admin .panel, .ls-admin .card {
  border: 1px solid var(--ls-line);
  border-radius: 15px;
  background: #fff;
}
.ls-site .item-card:hover, .ls-admin .admin-card:hover {
  border-color: #c8ddce;
  box-shadow: var(--ls-shadow);
}
.ls-site table, .ls-admin table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
}
.ls-site th, .ls-site td, .ls-admin th, .ls-admin td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--ls-line);
  text-align: left;
  vertical-align: middle;
}
.ls-site th, .ls-admin th {
  color: #52645a;
  background: #f6f9f6;
  font-size: .88em;
  font-weight: 750;
}
.ls-site .table-wrap, .ls-admin .table-wrap,
.ls-site .table-responsive, .ls-admin .table-responsive {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--ls-line);
  border-radius: 12px;
  background: #fff;
}
.ls-site .child { align-items: center; border-color: var(--ls-line); }
.ls-site .empty, .ls-admin .empty-state {
  border-color: #cbdccf;
  background: #f9fcf9;
  border-radius: 14px;
}

/* Admin visual system — supports existing semantic/common admin markup */
.ls-admin, body.ls-admin {
  background: #f4f7f4;
  color: var(--ls-ink);
}
.ls-admin header, .ls-admin .topbar, .ls-admin .admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--ls-line);
}
.ls-admin aside, .ls-admin .sidebar, .ls-admin .admin-sidebar {
  background: var(--ls-green-deep);
  color: #eff8f1;
}
.ls-admin aside a, .ls-admin .sidebar a, .ls-admin .admin-sidebar a {
  color: #e1eee5;
}
.ls-admin aside a:hover, .ls-admin .sidebar a:hover,
.ls-admin .admin-sidebar a:hover,
.ls-admin .active > a {
  background: rgba(31, 170, 101, .22);
  color: #fff;
}
.ls-admin main, .ls-admin .content, .ls-admin .admin-content {
  min-width: 0;
  padding: clamp(16px, 2.5vw, 32px);
}
.ls-admin h1, .ls-admin .page-title {
  color: #153b27;
  letter-spacing: -.6px;
}
.ls-admin .stat-card, .ls-admin .metric-card {
  padding: 18px;
  box-shadow: 0 3px 14px rgba(10, 44, 25, .035);
}
.ls-admin .stat-card strong, .ls-admin .metric-card strong {
  color: var(--ls-green-dark);
}
.ls-admin .badge, .ls-admin .status-badge,
.ls-site .badge, .ls-site .status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--ls-green-soft);
  color: var(--ls-green-dark);
  font-size: 12px;
  font-weight: 750;
}

/* Login, payment and checkout surfaces — styling only.
   Radio/checkbox choices remain visible and selectable. */
.ls-site .login-card, .ls-site .auth-card,
.ls-site .checkout-card, .ls-site .payment-card,
.ls-site .payment-method, .ls-site .payment-option,
.ls-site .method-option {
  border: 1px solid var(--ls-line);
  border-radius: 14px;
  background: #fff;
}
.ls-site .payment-option:has(input:checked),
.ls-site .payment-method:has(input:checked),
.ls-site .method-option:has(input:checked) {
  border-color: var(--ls-green);
  box-shadow: var(--ls-focus);
  background: #f7fcf8;
}
.ls-site .payment-option, .ls-site .payment-method,
.ls-site .method-option { cursor: pointer; }
.ls-site .payment-option input, .ls-site .payment-method input,
.ls-site .method-option input { accent-color: var(--ls-green); }

/* Reader: keep the reading surface usable on narrow screens */
.reader, .pdf-reader, .flipbook, .reader-shell {
  max-width: 100%;
  min-width: 0;
}
.reader-toolbar, .pdf-toolbar, .reader-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.reader canvas, .pdf-reader canvas, .flipbook canvas {
  max-width: 100%;
}

/* Footer and floating support actions */
.ls-site footer { background: #082f20; }
.ls-site footer a:hover { color: #fff; }
.ls-site .whatsapp-fab, .ls-site .support-fab {
  max-width: calc(100vw - 24px);
}

/* Medium screens */
@media (max-width: 1100px) {
  .ls-site header > .wrap { width: calc(100% - 24px); }
  .ls-site .nav { gap: 9px; }
  .ls-site .navlinks { gap: 12px; }
  .ls-site .search { width: 150px; }
  .ls-admin .sidebar, .ls-admin aside, .ls-admin .admin-sidebar {
    max-width: 260px;
  }
}

/* Tablet and mobile navigation */
@media (max-width: 900px) {
  .ls-site header { min-height: 66px; padding: 7px 0; }
  .ls-site .nav { position: relative; }
  .ls-site .navlinks {
    top: calc(100% + 8px);
    z-index: 50;
    max-height: min(72vh, 560px);
    overflow-y: auto;
    border: 1px solid var(--ls-line);
  }
  .ls-site .navright { margin-left: auto; }
  .ls-site .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ls-site .footgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ls-admin .admin-layout, .ls-admin .dashboard-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Phones */
@media (max-width: 600px) {
  body { overflow-x: hidden; }
  .ls-site .wrap { width: calc(100% - 28px); }
  .ls-site header > .wrap { width: calc(100% - 20px); }
  .ls-site .nav { gap: 8px; padding: 7px 9px; border-radius: 13px; }
  .ls-site .brand { font-size: 16px; letter-spacing: -.35px; }
  .ls-site .brand-mark { width: 30px; height: 30px; font-size: 15px; }
  .ls-site .menu { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; min-height: 38px; }
  .ls-site .ls-back-button { min-height: 35px; padding: 7px 9px; font-size: 12px; }
  .ls-site .navright { gap: 6px; }
  .ls-site .signin, .ls-site .signup { padding: 8px 10px; font-size: 12px; }
  .ls-site .hero { padding: 18px 0; }
  .ls-site .hero-inner { padding: 25px 20px; border-radius: 17px; }
  .ls-site .hero h1 { font-size: clamp(27px, 8vw, 36px); letter-spacing: -.9px; }
  .ls-site .hero p { font-size: 13px; }
  .ls-site .browse { padding: 25px 0; }
  .ls-site .browse-card { flex-basis: 155px; min-height: 96px; }
  .ls-site .section-title, .ls-site .featured-head h2 { font-size: 22px; }
  .ls-site .featured { padding: 28px 0; }
  .ls-site .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .ls-site .item-card { padding: 8px; border-radius: 13px; }
  .ls-site .cover { height: 100px; }
  .ls-site .item-card h3 { font-size: 13px; }
  .ls-site .item-card p { font-size: 11px; }
  .ls-site .page { padding: 22px 0 40px; }
  .ls-site .page > .wrap { padding-top: 18px; padding-bottom: 35px; }
  .ls-site .page-head h1 { font-size: 26px; }
  .ls-site .detail { padding: 17px; border-radius: 14px; }
  .ls-site .detail h1 { font-size: 24px; }
  .ls-site .child { align-items: flex-start; flex-direction: column; }
  .ls-site .form-grid, .ls-admin .form-grid { grid-template-columns: minmax(0, 1fr); }
  .ls-site .footgrid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .ls-site th, .ls-site td, .ls-admin th, .ls-admin td { padding: 9px 10px; }
  .ls-admin main, .ls-admin .content, .ls-admin .admin-content { padding: 14px; }
  .ls-admin .stat-grid, .ls-admin .stats-grid, .ls-admin .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ls-admin .sidebar, .ls-admin aside, .ls-admin .admin-sidebar {
    max-width: 100%;
    width: 100%;
  }
  .reader-toolbar, .pdf-toolbar, .reader-controls { gap: 6px; }
}

/* Very narrow phones */
@media (max-width: 380px) {
  .ls-site .cards { grid-template-columns: minmax(0, 1fr); }
  .ls-site .brand { font-size: 14px; }
  .ls-site .signin, .ls-site .signup { padding: 7px 8px; }
  .ls-admin .stat-grid, .ls-admin .stats-grid, .ls-admin .metrics-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ===== LabStudy checkout refinement v2 ===== */
.ls-site .ls-checkout-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  align-items: start;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.ls-site .ls-checkout-grid > .detail {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.ls-site .ls-checkout-grid .detail h2 {
  color: var(--ls-green-deep);
  font-size: clamp(20px, 2.2vw, 25px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.ls-site .ls-checkout-grid .detail > div[style*="display:flex"] {
  min-width: 0;
  flex-wrap: wrap;
  align-items: flex-start;
}
.ls-site .ls-checkout-grid .detail > div[style*="display:flex"] > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ls-site .ls-checkout-grid .detail > div[style*="display:flex"] > strong {
  white-space: nowrap;
}
.ls-site .ls-checkout-grid .muted {
  color: var(--ls-muted);
  overflow-wrap: anywhere;
}
.ls-site .ls-checkout-grid .ls-payment-form {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0 0 14px;
}
.ls-site .ls-checkout-grid .ls-payment-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 88px;
  padding: 15px;
  border: 1px solid #dce7df;
  border-radius: 14px;
  background: #fff;
  color: var(--ls-ink);
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.ls-site .ls-checkout-grid .ls-payment-option:hover {
  border-color: #9ac3a8;
  background: #fbfefb;
}
.ls-site .ls-checkout-grid .ls-payment-option.is-selected {
  border: 2px solid var(--ls-green);
  padding: 14px;
  background: #f3faf5;
  box-shadow: 0 0 0 3px rgba(8, 116, 67, .09);
}
.ls-site .ls-checkout-grid .ls-payment-radio {
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  margin: 3px 0 0;
  accent-color: var(--ls-green);
}
.ls-site .ls-checkout-grid .ls-payment-copy {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.ls-site .ls-checkout-grid .ls-payment-copy strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ls-green-deep);
  font-size: 16px;
  line-height: 1.35;
}
.ls-site .ls-checkout-grid .ls-payment-copy small {
  display: block;
  color: var(--ls-muted);
  font-size: 13px;
  line-height: 1.5;
}
.ls-site .ls-checkout-grid .ls-payment-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 16px;
  border: 0;
  border-radius: 11px;
  background: var(--ls-green);
  color: #fff;
  font-weight: 750;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
.ls-site .ls-checkout-grid .ls-payment-submit:hover {
  background: var(--ls-green-dark);
}
.ls-site .ls-checkout-grid .ls-payment-submit:focus-visible {
  outline: 0;
  box-shadow: var(--ls-focus);
}
.ls-site .ls-checkout-grid .ls-checkout-disabled {
  width: 100%;
  min-height: 46px;
  white-space: normal;
}

/* Checkout mobile layout: stack summary and payment instead of shrinking columns */
@media (max-width: 760px) {
  .ls-site .ls-checkout-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px;
  }
  .ls-site .ls-checkout-grid > .detail {
    padding: 17px;
    border-radius: 15px;
  }
  .ls-site .ls-checkout-grid .ls-payment-option {
    min-height: 76px;
    padding: 13px;
  }
  .ls-site .ls-checkout-grid .ls-payment-option.is-selected {
    padding: 12px;
  }
  .ls-site .ls-checkout-grid .ls-payment-copy strong {
    font-size: 15px;
  }
  .ls-site .ls-checkout-grid .ls-payment-copy small {
    font-size: 13px;
  }
  .ls-site .ls-checkout-grid .ls-payment-submit {
    min-height: 48px;
  }
}
@media (max-width: 380px) {
  .ls-site .ls-checkout-grid > .detail { padding: 14px; }
  .ls-site .ls-checkout-grid .ls-payment-option { gap: 9px; padding: 11px; }
  .ls-site .ls-checkout-grid .ls-payment-option.is-selected { padding: 10px; }
  .ls-site .ls-checkout-grid .ls-payment-copy strong { font-size: 14px; }
  .ls-site .ls-checkout-grid .ls-payment-copy small { font-size: 12px; }
}

/* Avoid mobile viewport expansion from long admin table content. */
@media (max-width: 640px) {
  .adm-main, .adm-content { min-width: 0; max-width: 100%; }
  .adm-content .panel, .adm-content .section, .adm-content .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .adm-content table { max-width: 100%; }
}

.ls-site .ls-checkout-grid .ls-payment-option.needs-choice {
  border-color: #bd7a23;
  box-shadow: 0 0 0 3px rgba(189, 122, 35, .12);
}

/* LABSTUDY HEADER VISIBILITY FIX V1 */

/* Mobile-only menu elements must not appear in desktop navbar */
.ls-site .mobile-search-wrap,
.ls-site .mobile-account-links {
    display: none !important;
}

/* Show them only inside the opened mobile navigation */
@media (max-width: 900px) {
    .ls-site .navlinks .mobile-search-wrap {
        display: block !important;
        width: 100%;
        margin-top: 5px;
    }

    .ls-site .navlinks .mobile-search {
        display: block !important;
        width: 100%;
        min-height: 42px;
        box-sizing: border-box;
    }

    .ls-site .navlinks .mobile-account-links {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        padding-top: 12px;
        border-top: 1px solid #e1e9e3;
    }

    .ls-site .mobile-account-links form {
        width: 100%;
        margin: 0;
    }

    .ls-site .mobile-account-links form button {
        width: 100%;
    }
}

/* END HEADER VISIBILITY FIX V1 */
