/* v2-public.css — anonymous pages, shadcn-style, red primary
 * Loaded via main.html when theme_v2=1 AND hide_menu=1 AND not admin.
 * Scoped under body.v2 so admin and classic remain untouched.
 */

/* =========================================================================
   1. Base typography & surfaces
   ========================================================================= */
body.v2 {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

body.v2 a { color: hsl(var(--foreground)); text-decoration: none; transition: color .15s ease; }
/* Global anchor-hover paint, wrapped in :where() so its specificity is 0.
   Any anchor with its own colour rule (button classes like .mu-btn / .btn-*,
   coloured-card link rules like `.ds-tile--accent .ds-meta a`, etc.) wins
   automatically — without us having to enumerate every selector or use
   !important. This is the global fix for the "link disappears on hover
   inside a coloured box/button" pattern. */
body.v2 :where(a:hover) { color: hsl(var(--primary)); }
body.v2 a.link-primary { color: hsl(var(--primary)); }
body.v2 a.link-primary:hover { color: hsl(var(--primary-hover)); }
body.v2 a.link-secondary { color: hsl(var(--muted-foreground)); }
body.v2 a.link-secondary:hover { color: hsl(var(--foreground)); }
body.v2 a.link-body-emphasis { color: hsl(var(--foreground)); }
body.v2 .text-muted { color: hsl(var(--muted-foreground)) !important; }
body.v2 .text-dark { color: hsl(var(--foreground)) !important; }

body.v2 h1, body.v2 h2, body.v2 h3, body.v2 h4, body.v2 h5, body.v2 h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: hsl(var(--foreground));
}
body.v2 h1, body.v2 .fs-1 { font-size: 2.25rem; }
body.v2 h2, body.v2 .fs-2 { font-size: 1.875rem; }
body.v2 h3, body.v2 .fs-3 { font-size: 1.5rem; }
body.v2 h4, body.v2 .fs-4 { font-size: 1.25rem; }
body.v2 h5, body.v2 .fs-5 { font-size: 1.125rem; }
body.v2 small, body.v2 .small { font-size: 0.8125rem; }

body.v2 hr { border-color: hsl(var(--border)); opacity: 1; }

body.v2 ::selection { background: hsl(var(--primary) / 0.2); color: hsl(var(--foreground)); }

body.v2 main {
  min-height: calc(100vh - 200px);
}

body.v2 .container,
body.v2 .container-fluid {
  max-width: var(--container-max);
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* =========================================================================
   2. Buttons
   ========================================================================= */
body.v2 .btn {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  padding: 0.5625rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  --bs-btn-active-shadow: none;
}
body.v2 .btn:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}
body.v2 .btn-primary {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-xs);
}
body.v2 .btn-primary:hover,
body.v2 .btn-primary:focus,
body.v2 .btn-primary:active {
  background: hsl(var(--primary-hover));
  border-color: hsl(var(--primary-hover));
  color: hsl(var(--primary-foreground));
}
body.v2 .btn-secondary {
  background: hsl(var(--secondary));
  border-color: hsl(var(--border));
  color: hsl(var(--secondary-foreground));
}
body.v2 .btn-secondary:hover {
  background: hsl(var(--muted));
  color: hsl(var(--secondary-foreground));
}
body.v2 .btn-outline-primary {
  background: transparent;
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}
body.v2 .btn-outline-primary:hover {
  background: hsl(var(--muted));
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}
body.v2 .btn-outline-secondary {
  background: transparent;
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}
body.v2 .btn-outline-secondary:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}
body.v2 .btn-danger,
body.v2 .btn-outline-danger:hover {
  background: hsl(var(--destructive));
  border-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}
body.v2 .btn-outline-danger {
  background: transparent;
  border-color: hsl(var(--border));
  color: hsl(var(--destructive));
}
body.v2 .btn-success {
  background: hsl(var(--success));
  border-color: hsl(var(--success));
  color: hsl(var(--success-foreground));
}
body.v2 .btn-link {
  color: hsl(var(--primary));
  background: transparent;
  border-color: transparent;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
}
body.v2 .btn-link:hover { color: hsl(var(--primary-hover)); text-decoration: underline; }
body.v2 .btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; border-radius: var(--radius-sm); }
body.v2 .btn-lg { padding: 0.75rem 1.25rem; font-size: 1rem; border-radius: var(--radius-md); }
body.v2 .icon-btn {
  background: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  padding: 0.5rem;
  border-radius: var(--radius);
  width: 2.25rem;
  height: 2.25rem;
}
body.v2 .icon-btn:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}
body.v2 .submit-btn {
  width: 100%;
  padding: 0.625rem 1rem;
  font-weight: 600;
}
body.v2 .reg-btn { padding: 0.5rem 1rem; font-weight: 500; }
body.v2 .login-btn { padding: 0.5rem 1rem; font-weight: 500; }

/* =========================================================================
   3. Cards / "block" (XFS-specific) / panels
   ========================================================================= */
body.v2 .card,
body.v2 .block {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 1.5rem;
}
body.v2 .card-header,
body.v2 .block-header {
  border-bottom: 1px solid hsl(var(--border));
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  font-weight: 600;
  background: transparent;
}
body.v2 .card-body { padding: 0; }
body.v2 .card-footer {
  border-top: 1px solid hsl(var(--border));
  padding-top: 1rem;
  margin-top: 1rem;
  background: transparent;
}

/* =========================================================================
   4. Forms
   ========================================================================= */
body.v2 .form-control,
body.v2 .form-select {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
body.v2 .form-control:focus,
body.v2 .form-select:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}
body.v2 .form-control::placeholder { color: hsl(var(--muted-foreground)); }
body.v2 .form-control[readonly] { background: hsl(var(--muted)); }
body.v2 .form-control:disabled { opacity: 0.6; cursor: not-allowed; }
body.v2 textarea.form-control { min-height: 6rem; }

body.v2 .form-floating > label {
  color: hsl(var(--muted-foreground));
  padding: 0.625rem 0.75rem;
}
body.v2 .form-floating > .form-control {
  padding: 1rem 0.75rem 0.25rem;
  height: 3.25rem;
}
body.v2 .form-floating > .form-control:focus ~ label,
body.v2 .form-floating > .form-control:not(:placeholder-shown) ~ label {
  transform: scale(0.85) translateY(-0.6rem) translateX(0.15rem);
  color: hsl(var(--muted-foreground));
}

body.v2 .form-label,
body.v2 label.form-label {
  font-weight: 500;
  font-size: 0.8125rem;
  color: hsl(var(--foreground));
  margin-bottom: 0.375rem;
}

body.v2 .form-check-input {
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
}
body.v2 .form-check-input:checked {
  background-color: hsl(var(--primary));
  border-color: hsl(var(--primary));
}
body.v2 .form-check-input:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}

body.v2 .input-group-text {
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--input));
  color: hsl(var(--muted-foreground));
}

/* =========================================================================
   5. Alerts
   ========================================================================= */
body.v2 .alert {
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
}
body.v2 .alert-success {
  background: hsl(var(--success) / 0.08);
  border-color: hsl(var(--success) / 0.35);
  color: hsl(var(--foreground));
}
body.v2 .alert-danger,
body.v2 .alert-error {
  background: hsl(var(--destructive) / 0.08);
  border-color: hsl(var(--destructive) / 0.35);
  color: hsl(var(--destructive));
}
body.v2 .alert-warning {
  background: hsl(var(--warning) / 0.08);
  border-color: hsl(var(--warning) / 0.35);
  color: hsl(var(--foreground));
}
body.v2 .alert-info {
  background: hsl(var(--muted));
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

/* =========================================================================
   6. Nav, tabs (Bootstrap + XFS .block-tabs)
   ========================================================================= */
body.v2 .nav-link {
  color: hsl(var(--muted-foreground));
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius);
  transition: background .15s ease, color .15s ease;
}
body.v2 .nav-link:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
}
body.v2 .nav-link.active {
  color: hsl(var(--foreground));
  font-weight: 600;
}
body.v2 .nav-tabs {
  border-bottom: 1px solid hsl(var(--border));
  gap: 0.25rem;
}
body.v2 .nav-tabs .nav-link {
  border: 1px solid transparent;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0.625rem 1rem;
  margin-bottom: -1px;
  background: transparent;
}
body.v2 .nav-tabs .nav-link.active {
  background: hsl(var(--background));
  border-color: hsl(var(--border)) hsl(var(--border)) hsl(var(--background));
  color: hsl(var(--primary));
}
body.v2 .block-tabs {
  border-bottom: 1px solid hsl(var(--border));
  padding: 0 0.5rem;
  gap: 0.25rem;
  background: hsl(var(--subtle));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
body.v2 .block-tabs .nav-link {
  position: relative;
  padding: 0.875rem 1rem;
  border-radius: 0;
  background: transparent;
  border: none;
}
body.v2 .block-tabs .nav-link.active {
  color: hsl(var(--primary));
  background: transparent;
  border: none;
}
body.v2 .block-tabs .nav-link.active::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: -1px;
  height: 2px;
  background: hsl(var(--primary));
  border-radius: 2px 2px 0 0;
}

/* =========================================================================
   7. Tables
   ========================================================================= */
body.v2 .table {
  --bs-table-bg: transparent;
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
  font-size: 0.875rem;
}
body.v2 .table > thead {
  background: hsl(var(--subtle));
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
}
body.v2 .table > thead th {
  font-weight: 500;
  border-bottom: 1px solid hsl(var(--border));
  padding: 0.625rem 0.75rem;
}
body.v2 .table > tbody td {
  padding: 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
  vertical-align: middle;
}
body.v2 .table > tbody tr:last-child td { border-bottom: none; }
body.v2 .table-hover > tbody > tr:hover > * { background: hsl(var(--muted) / 0.5); }
body.v2 .table-striped > tbody > tr:nth-of-type(odd) > * {
  background: hsl(var(--subtle));
}

/* =========================================================================
   8. Dropdown menu
   ========================================================================= */
body.v2 .dropdown-menu {
  background: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 0.25rem;
  min-width: 12rem;
  font-size: 0.875rem;
}
body.v2 .dropdown-item {
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.625rem;
  color: hsl(var(--popover-foreground));
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
body.v2 .dropdown-item:hover,
body.v2 .dropdown-item:focus {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
body.v2 .dropdown-divider { border-top-color: hsl(var(--border)); margin: 0.25rem 0; }

/* =========================================================================
   9. Modal
   ========================================================================= */
body.v2 .modal-content {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
body.v2 .modal-header { border-bottom: 1px solid hsl(var(--border)); }
body.v2 .modal-footer { border-top: 1px solid hsl(var(--border)); }
body.v2 .modal-backdrop.show { opacity: 0.6; }

/* =========================================================================
   10. Pagination, badges, progress
   ========================================================================= */
body.v2 .pagination {
  gap: 0.25rem;
}
body.v2 .page-link {
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin: 0 !important;
}
body.v2 .page-link:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
body.v2 .page-item.active .page-link {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

body.v2 .badge {
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}
body.v2 .badge.bg-primary { background: hsl(var(--primary)) !important; color: hsl(var(--primary-foreground)) !important; }
body.v2 .badge.bg-secondary { background: hsl(var(--secondary)) !important; color: hsl(var(--secondary-foreground)) !important; }

body.v2 .progress {
  background: hsl(var(--muted));
  border-radius: 999px;
  height: 0.5rem;
}
body.v2 .progress-bar {
  background: hsl(var(--primary));
  border-radius: 999px;
}

/* =========================================================================
   11. Header (anonymous) — generic styling, will be replaced by header_v2.html
   ========================================================================= */
body.v2 .header {
  background: hsl(var(--background) / 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid hsl(var(--border));
  position: sticky;
  top: 0;
  z-index: 100;
}
body.v2 .header .header-row {
  min-height: 3.75rem;
}
body.v2 .header .nav-link {
  font-weight: 500;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
body.v2 .header .nav-link:hover {
  color: hsl(var(--foreground));
  background: transparent;
}
body.v2 .header .logo img {
  height: 1.75rem;
  width: auto;
}
body.v2 .header-lang .icon-btn {
  border: none;
  background: transparent;
}
body.v2 .header-lang img {
  width: 1.25rem;
  height: auto;
  border-radius: 2px;
}
body.v2 .header-row .reg-btn {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

/* =========================================================================
   12. Footer
   ========================================================================= */
body.v2 footer,
body.v2 .footer {
  background: hsl(var(--subtle));
  border-top: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}
body.v2 footer a,
body.v2 .footer a { color: hsl(var(--muted-foreground)); }
body.v2 footer a:hover,
body.v2 .footer a:hover { color: hsl(var(--foreground)); }
body.v2 footer h5,
body.v2 .footer h5 {
  color: hsl(var(--foreground));
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}
body.v2 .page-buffer { height: 2rem; }

/* =========================================================================
   13. Login / Register / Auth pages
   ========================================================================= */
body.v2 .login,
body.v2 form[name="FL"],
body.v2 form[name="FR"],
body.v2 .register {
  max-width: 28rem;
  margin: 4rem auto;
  padding: 2rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
body.v2 .login h1,
body.v2 .register h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
body.v2 .login-social {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}
body.v2 .divider-text {
  position: relative;
  text-align: center;
  margin: 1rem 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
body.v2 .divider-text::before,
body.v2 .divider-text::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 1.5rem);
  height: 1px;
  background: hsl(var(--border));
}
body.v2 .divider-text::before { left: 0; }
body.v2 .divider-text::after { right: 0; }
body.v2 .login-social a img,
body.v2 .login-social img {
  width: 2rem; height: 2rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  padding: 0.25rem;
  background: hsl(var(--background));
  transition: border-color .15s ease;
}
body.v2 .login-social a:hover img { border-color: hsl(var(--primary)); }

/* =========================================================================
   14. Upload form / dropbox / upload result tabs
   ========================================================================= */
body.v2 .upload-form { padding-top: 2rem; padding-bottom: 2rem; }
body.v2 .upload-form .block { padding: 0; overflow: hidden; }
body.v2 .upload-form .block > .p-3,
body.v2 .upload-form .block > .p-lg-5 { padding: 1.5rem !important; }

body.v2 .dropbox {
  border: 2px dashed hsl(var(--border));
  border-radius: var(--radius-lg);
  background: hsl(var(--subtle));
  padding: 3rem 1.5rem;
  text-align: center;
  color: hsl(var(--muted-foreground));
  position: relative;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
body.v2 .dropbox:hover {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.04);
}
body.v2 .dropbox .link-primary {
  color: hsl(var(--primary));
  font-weight: 600;
  cursor: pointer;
}
body.v2 .dropbox input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
body.v2 #dropzone {
  background: hsl(var(--primary) / 0.06);
  border: 2px dashed hsl(var(--primary));
  border-radius: var(--radius-lg);
  color: hsl(var(--primary));
  text-align: center;
  padding: 2rem;
  margin-bottom: 1rem;
}

body.v2 .codes-textarea {
  position: relative;
}
body.v2 .codes-textarea textarea {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  background: hsl(var(--subtle));
  padding-right: 3rem;
}
body.v2 .codes-textarea .icon-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

body.v2 .uploadItem {
  background: hsl(var(--subtle));
  border-radius: var(--radius-lg);
  padding: 1rem 0;
  margin-top: 1rem;
}

body.v2 .upload-status,
body.v2 .upload-progress {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* =========================================================================
   15. Download pages (download0/1/2)
   ========================================================================= */
body.v2 .download-section,
body.v2 .filename-section,
body.v2 .file-info {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2rem auto;
  max-width: 42rem;
}
body.v2 .download-section h1,
body.v2 .filename-section h1 {
  font-size: 1.25rem;
  font-weight: 600;
  word-break: break-all;
}
body.v2 .download-btn,
body.v2 .free-download,
body.v2 .premium-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  min-width: 12rem;
}
body.v2 .free-download {
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--secondary-foreground));
}
body.v2 .free-download:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}
body.v2 .premium-download {
  background: hsl(var(--primary));
  border: 1px solid hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
body.v2 .premium-download:hover {
  background: hsl(var(--primary-hover));
  color: hsl(var(--primary-foreground));
}

body.v2 .countdown {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: hsl(var(--primary));
}

/* =========================================================================
   16. Premium / payments / comparison
   ========================================================================= */
body.v2 .premium-plans,
body.v2 .pricing-grid,
body.v2 .comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
body.v2 .premium-plan,
body.v2 .pricing-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
body.v2 .premium-plan:hover,
body.v2 .pricing-card:hover {
  border-color: hsl(var(--primary));
  box-shadow: var(--shadow);
}
body.v2 .premium-plan.featured,
body.v2 .premium-plan.recommended {
  border-color: hsl(var(--primary));
  background: linear-gradient(180deg, hsl(var(--primary) / 0.04), transparent);
  position: relative;
}
body.v2 .price {
  font-size: 2rem;
  font-weight: 800;
  color: hsl(var(--foreground));
  letter-spacing: -0.025em;
}
body.v2 .price-period {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  font-weight: 400;
}

/* =========================================================================
   17. News / catalogue / generic content
   ========================================================================= */
body.v2 .news-item,
body.v2 article {
  border-bottom: 1px solid hsl(var(--border));
  padding: 1.25rem 0;
}
body.v2 .news-item:last-child,
body.v2 article:last-child { border-bottom: none; }
body.v2 .news-title,
body.v2 article h2,
body.v2 article h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
body.v2 .news-meta,
body.v2 .article-meta {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.5rem;
}

body.v2 .catalogue-list,
body.v2 .file-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
body.v2 .catalogue-list li,
body.v2 .file-list li {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

body.v2 .text-content,
body.v2 .page {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 50rem;
  margin: 2rem auto;
}
body.v2 .page h1, body.v2 .page h2, body.v2 .page h3 { margin-top: 1.5rem; margin-bottom: 0.75rem; }
body.v2 .page h1:first-child { margin-top: 0; }

/* =========================================================================
   18. Message / error / splash pages
   ========================================================================= */
body.v2 .message,
body.v2 .splash,
body.v2 .error-page {
  max-width: 32rem;
  margin: 4rem auto;
  padding: 2rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  text-align: center;
}

/* =========================================================================
   19. Misc utility overrides for compatibility
   ========================================================================= */
body.v2 .fw-500 { font-weight: 500 !important; }
body.v2 .fw-600 { font-weight: 600 !important; }
body.v2 .fw-700 { font-weight: 700 !important; }

body.v2 .border { border-color: hsl(var(--border)) !important; }
body.v2 .border-top { border-top-color: hsl(var(--border)) !important; }
body.v2 .border-bottom { border-bottom-color: hsl(var(--border)) !important; }

body.v2 .bg-light { background: hsl(var(--subtle)) !important; }
body.v2 .bg-white { background: hsl(var(--card)) !important; }

body.v2 .shadow-sm { box-shadow: var(--shadow-sm) !important; }
body.v2 .shadow { box-shadow: var(--shadow) !important; }
body.v2 .shadow-lg { box-shadow: var(--shadow-lg) !important; }

body.v2 .rounded { border-radius: var(--radius) !important; }
body.v2 .rounded-pill { border-radius: 999px !important; }

body.v2 code, body.v2 kbd, body.v2 pre, body.v2 samp {
  font-family: var(--font-mono);
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
  padding: 0.125rem 0.375rem;
  font-size: 0.8125rem;
}
body.v2 pre {
  padding: 1rem;
  overflow-x: auto;
}

/* Captcha image — keep it visible but centered */
body.v2 img[alt*="captcha" i], body.v2 .captcha img {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
}

/* =========================================================================
   20. v2 header (header_v2.html)
   ========================================================================= */
body.v2 .v2-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: hsl(var(--background) / 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid hsl(var(--border));
}
body.v2 .v2-header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 3.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
body.v2 .v2-header-left, body.v2 .v2-header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
body.v2 .v2-header-left { gap: 1.5rem; flex: 1 1 auto; min-width: 0; }
body.v2 .v2-header-right { flex-shrink: 0; }

body.v2 .v2-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
  text-decoration: none;
  white-space: nowrap;
}
body.v2 .v2-logo:hover { color: hsl(var(--foreground)); }
body.v2 .v2-logo-mark {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--radius-sm);
  background: hsl(var(--primary));
  position: relative;
  flex-shrink: 0;
}
body.v2 .v2-logo-mark::after {
  content: "";
  position: absolute;
  inset: 0.3125rem;
  border: 2px solid hsl(var(--primary-foreground));
  border-radius: 2px;
  border-bottom: none;
  border-right: none;
  transform: rotate(45deg);
}

body.v2 .v2-nav {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  margin-left: 0.5rem;
}
body.v2 .v2-navlink {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4375rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color .15s ease, background .15s ease;
}
body.v2 .v2-navlink:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
}

body.v2 .v2-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--muted-foreground));
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
body.v2 .v2-iconbtn:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}
body.v2 .v2-iconbtn img { width: 1.125rem; height: auto; border-radius: 2px; }
body.v2 .v2-iconbtn:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

body.v2 .v2-skinswitch {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
body.v2 .v2-skinswitch:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--muted));
}

body.v2 .v2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4375rem 0.875rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
body.v2 .v2-btn-ghost {
  color: hsl(var(--foreground));
  background: transparent;
  border-color: transparent;
}
body.v2 .v2-btn-ghost:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
body.v2 .v2-btn-primary {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
body.v2 .v2-btn-primary:hover {
  background: hsl(var(--primary-hover));
  color: hsl(var(--primary-foreground));
}

body.v2 .v2-userbtn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  padding: 0.3125rem 0.625rem 0.3125rem 0.3125rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
body.v2 .v2-userbtn:hover { background: hsl(var(--muted)); }
body.v2 .v2-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  overflow: hidden;
  text-indent: -9999px;
  position: relative;
}
body.v2 .v2-avatar::before {
  content: attr(data-initial);
  text-indent: 0;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Fallback: pull first char from inner text via ::first-letter is impossible inline,
   so we just show the colored circle as a generic mark. */
body.v2 .v2-avatar::first-letter { text-indent: 0; }

/* =========================================================================
   21. v2 footer (footer_v2.html)
   ========================================================================= */
body.v2 .v2-footer {
  background: hsl(var(--subtle));
  border-top: 1px solid hsl(var(--border));
  margin-top: 4rem;
}
body.v2 .v2-footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 4rem 1.25rem 1.5rem;
}
body.v2 .v2-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 2rem;
  padding-bottom: 3rem;
}
@media (max-width: 900px) {
  body.v2 .v2-footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  body.v2 .v2-footer-brand { grid-column: span 2; }
}
@media (max-width: 480px) {
  body.v2 .v2-footer-grid { grid-template-columns: 1fr; }
  body.v2 .v2-footer-brand { grid-column: span 1; }
}
body.v2 .v2-footer-tagline {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  margin: 0.875rem 0 1rem;
  max-width: 16rem;
}
body.v2 .v2-footer-col h5 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--foreground));
  margin: 0 0 1rem;
}
body.v2 .v2-footer-col a {
  display: block;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  padding: 0.25rem 0;
  text-decoration: none;
}
body.v2 .v2-footer-col a:hover { color: hsl(var(--foreground)); }
body.v2 .v2-footer-col a.v2-theme-active {
  color: hsl(var(--primary));
  font-weight: 500;
}
body.v2 .v2-social {
  display: flex;
  gap: 0.5rem;
}
body.v2 .v2-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  background: hsl(var(--background));
  transition: border-color .15s ease, background .15s ease;
}
body.v2 .v2-social a:hover {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.06);
}
body.v2 .v2-social img {
  width: 1rem;
  height: auto;
  opacity: 0.8;
}
body.v2 .v2-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--border));
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}
body.v2 .v2-footer-bottom a { color: hsl(var(--muted-foreground)); }
body.v2 .v2-footer-bottom a:hover { color: hsl(var(--foreground)); }
body.v2 .v2-footer-meta { display: flex; gap: 1rem; }

/* Print fixes */
@media print {
  body.v2 .v2-header, body.v2 .v2-footer { display: none; }
}

/* =========================================================================
   22. Inline-style template overrides
   These rules override <style> blocks inside specific templates that emit
   markup into the body. Source order favors body-inline blocks, so we use
   !important strictly for the properties we need to recolor.
   ========================================================================= */

/* gdpr_cookie_notice.html — recolor banner to match shadcn surfaces */
body.v2 #gdpr-cookie-notice {
  background: hsl(var(--card)) !important;
  color: hsl(var(--foreground)) !important;
  border-left: 4px solid hsl(var(--primary)) !important;
  border-top: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-md);
}
body.v2 #gdpr-cookie-notice a { color: hsl(var(--primary)); }
body.v2 #gdpr-cookie-notice .btn {
  font-size: 0.8125rem;
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

/* internal_error.html — match v2 surfaces (white card / proper foreground) */
body.v2 div.centered {
  background: hsl(var(--card)) !important;
  color: hsl(var(--foreground)) !important;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 32rem;
  margin: 0 auto;
  position: static !important;
  transform: none !important;
}
body.v2 .error-id {
  color: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
  font-weight: 500 !important;
}

/* files.html — .files-total badge */
body.v2 .files-total {
  background: hsl(var(--muted)) !important;
  color: hsl(var(--muted-foreground)) !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600;
}

/* g2fa_toggle.html — 2FA code input keeps tracking-wide styling but inherits v2 colors */
body.v2 #g2fa-code {
  font-family: var(--font-mono);
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}
body.v2 #g2fa-code:focus {
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}

/* buy_bitcoin.html — progress bar uses primary color */
body.v2 .progressbar,
body.v2 .progressbar-inner {
  border-radius: 999px;
}
body.v2 .progressbar-inner {
  background: hsl(var(--primary)) !important;
  height: 0.5rem;
}

/* nic_edit.html — text editor inherits surface */
body.v2 .nicEdit-main {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border-radius: var(--radius-sm);
}

/* Mobile tweaks */
@media (max-width: 640px) {
  body.v2 .login,
  body.v2 form[name="FL"],
  body.v2 form[name="FR"] {
    margin: 1.5rem 1rem;
    padding: 1.5rem;
  }
  body.v2 main { padding-bottom: 1rem; }
}
