/* Shared dark boxed treatment for public pages that do not extend base.html. */
:root {
  --public-bg: #090b0d;
  --public-shell: #111519;
  --public-panel: #14181d;
  --public-panel-hover: #1b2027;
  --public-accent: #a3e635;
  --public-text: #f3f4f6;
  --public-muted: #a3adb9;
  --public-border: #2a3038;
}

body.public-shell-page {
  background: var(--public-bg) !important;
  color: var(--public-text) !important;
}

/* Keep ordinary links lime in their normal, visited, and pressed states.
   Buttons and card-style links retain their component contrast. */
body.public-auth-page .auth-header a,
body.public-auth-page .auth-header a:visited,
body.public-auth-page .auth-header a:active,
body.public-auth-page .forgot-link,
body.public-auth-page .forgot-link:visited,
body.public-auth-page .forgot-link:active,
body.public-auth-page .back-link,
body.public-auth-page .back-link:visited,
body.public-auth-page .back-link:active,
body.public-error-page .error-message a,
body.public-error-page .error-message a:visited,
body.public-error-page .error-message a:active,
body.public-error-page .suggestions-links a,
body.public-error-page .suggestions-links a:visited,
body.public-error-page .suggestions-links a:active,
body.public-tool-page a:not(.btn):not(.btn-primary):not(.btn-secondary),
body.public-tool-page a:not(.btn):not(.btn-primary):not(.btn-secondary):visited,
body.public-tool-page a:not(.btn):not(.btn-primary):not(.btn-secondary):active {
  color: var(--public-accent) !important;
}

body.public-auth-page {
  padding: 16px !important;
}

body.public-auth-page .auth-container {
  width: 100%;
  max-width: 1280px;
  min-height: calc(100vh - 32px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--public-border);
  border-radius: 24px;
  background: var(--public-shell);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

body.public-auth-page .auth-brand {
  background: var(--public-panel) !important;
  border-right-color: var(--public-border) !important;
}

body.public-auth-page .auth-form-section {
  background: var(--public-shell) !important;
}

body.public-auth-page .brand-logo,
body.public-auth-page .auth-header h1,
body.public-auth-page .form-group label {
  color: var(--public-text) !important;
}

body.public-auth-page .brand-logo .name span,
body.public-auth-page .brand-headline span,
body.public-auth-page .auth-header a,
body.public-auth-page .forgot-link,
body.public-auth-page .back-link {
  color: var(--public-accent) !important;
}

body.public-auth-page .brand-description,
body.public-auth-page .brand-usecase,
body.public-auth-page .auth-header p,
body.public-auth-page .helper-text,
body.public-auth-page .micro-trust,
body.public-auth-page .micro-trust-item,
body.public-auth-page .security-item,
body.public-auth-page .reassurance-item {
  color: var(--public-muted) !important;
}

body.public-auth-page input,
body.public-auth-page .btn-google {
  background: #0b0e11 !important;
  border-color: var(--public-border) !important;
  color: var(--public-text) !important;
}

body.public-auth-page input:focus {
  border-color: var(--public-accent) !important;
}

body.public-auth-page .btn-submit,
body.public-auth-page .error-state a {
  background: var(--public-accent) !important;
  color: #111827 !important;
  box-shadow: none !important;
}

body.public-auth-page .auth-divider::before,
body.public-auth-page .auth-divider::after {
  background: var(--public-border) !important;
}

body.public-auth-page .trust-bar,
body.public-auth-page .brand-stats {
  border-top-color: var(--public-border) !important;
}

body.public-error-page {
  padding: 16px !important;
}

body.public-error-page .logo {
  color: var(--public-text) !important;
}

body.public-error-page .logo .name span {
  color: var(--public-accent) !important;
}

body.public-error-page .error-container {
  width: 100%;
  max-width: 720px;
  padding: 64px 48px;
  border: 1px solid var(--public-border);
  border-radius: 24px;
  background: var(--public-shell);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

body.public-error-page .error-message,
body.public-error-page .suggestions-title {
  color: var(--public-muted) !important;
}

body.public-error-page .btn-primary {
  background: var(--public-accent) !important;
  color: #111827 !important;
  box-shadow: none !important;
}

body.public-error-page .btn-secondary,
body.public-error-page .suggestions-links a {
  background: var(--public-panel) !important;
  border-color: var(--public-border) !important;
}

body.public-error-page .btn-secondary {
  color: var(--public-text) !important;
}

body.public-error-page .suggestions-links a,
body.public-error-page .suggestions-links a:visited,
body.public-error-page .suggestions-links a:active {
  color: var(--public-accent) !important;
}

body.public-tool-page {
  padding: 16px !important;
}

body.public-tool-page > .container {
  max-width: 1280px !important;
  min-height: calc(100vh - 32px);
  padding: 48px !important;
  border: 1px solid var(--public-border);
  border-radius: 24px;
  background: var(--public-shell);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

body.public-tool-page h1,
body.public-tool-page h2,
body.public-tool-page h3 {
  color: var(--public-text);
}

body.public-tool-page .subtitle,
body.public-tool-page .result-label,
body.public-tool-page .mx-priority {
  color: var(--public-muted);
}

body.public-tool-page input,
body.public-tool-page .results,
body.public-tool-page .bulk-section,
body.public-tool-page .known-providers {
  background: var(--public-panel) !important;
  border-color: var(--public-border) !important;
}

body.public-tool-page input {
  color: var(--public-text) !important;
}

body.public-tool-page button {
  background: var(--public-accent) !important;
  color: #111827 !important;
}

@media (max-width: 720px) {
  body.public-auth-page {
    padding: 8px !important;
  }

  body.public-auth-page .auth-container,
  body.public-error-page .error-container,
  body.public-tool-page > .container {
    border-radius: 18px;
  }

  body.public-error-page,
  body.public-tool-page {
    padding: 8px !important;
  }

  body.public-error-page .error-container,
  body.public-tool-page > .container {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 32px 20px !important;
  }

  body.public-tool-page > .container {
    overflow: hidden;
  }

  body.public-tool-page .search-box {
    min-width: 0;
    flex-wrap: wrap;
  }

  body.public-tool-page .search-box input,
  body.public-tool-page textarea {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.public-tool-page .search-box input {
    flex: 1 1 180px;
  }

  body.public-tool-page .bulk-result-row {
    min-width: 0;
    gap: 10px;
    overflow-wrap: anywhere;
  }
}
