/* The company page and every settings page opened from it.

   Bootstrap's reboot (a, h1-h6, p, label, ...) is not in a cascade layer, and unlayered rules
   always beat Tailwind's layered utilities. That is why links came out blue and underlined and
   the small section titles came out as huge Bootstrap headings. Inside .cp-hub those element
   rules are rolled back, so the Tailwind classes in the markup decide again.
   :where() keeps the specificity at a plain element selector, so Bootstrap classes that a page
   still uses on purpose (.btn, .form-control, .form-floating > label, ...) keep working. */
:where(.cp-hub) :is(a, h1, h2, h3, h4, h5, h6, p, small, label, dl, dt, dd, ul, ol, hr, legend) {
    all: revert-layer;
}

/* app.css makes every button at least 44x44px on phones; the hub sizes its own buttons. */
:where(.cp-hub) button {
    min-width: revert-layer;
    min-height: revert-layer;
}

/* Settings pages: black buttons, links in the text colour, no blue. Also used on pages that are
   still built from Bootstrap classes (integrations, account pages). */
.cp-settings .btn-primary,
.cp-settings .btn-primary:disabled {
    background-color: #222222;
    border-color: #222222;
    color: #fff;
}

.cp-settings .btn-primary:hover,
.cp-settings .btn-primary:focus,
.cp-settings .btn-primary:active {
    background-color: #000;
    border-color: #000;
    color: #fff;
}

.cp-settings .btn-outline-primary {
    background-color: #fff;
    border-color: #d1d5db;
    color: #111827;
}

.cp-settings .btn-outline-primary:hover,
.cp-settings .btn-outline-primary:focus,
.cp-settings .btn-outline-primary:active {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    color: #111827;
}

.cp-settings .btn {
    border-radius: 9999px;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    min-height: 44px;
    font-weight: 500;
    box-shadow: none;
}

.cp-settings .btn:focus-visible {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111827;
}

.cp-settings .btn-link,
.cp-settings .text-primary {
    color: #111827 !important;
}

/* Plain text links (no classes). Links styled with Tailwind classes keep their own colours. */
.cp-settings a:not([class]) {
    color: #111827;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cp-settings .form-control,
.cp-settings .form-select {
    border-radius: 0.75rem;
    border-color: #d1d5db;
}

.cp-settings .form-control:focus,
.cp-settings .form-select:focus,
.cp-settings .form-check-input:focus {
    border-color: #111827;
    box-shadow: 0 0 0 1px #111827;
}

.cp-settings .form-check-input:checked {
    background-color: #222222;
    border-color: #222222;
}

.cp-settings .card {
    border-radius: 1rem;
    border-color: #e5e7eb;
    box-shadow: none !important;
}

.cp-settings .alert {
    border-radius: 0.75rem;
}

.cp-settings .spinner-border.text-primary {
    color: #111827 !important;
}

/* The account pages (password, two-factor, personal data, ...) are still Bootstrap markup; give
   their headings the same calm size as the rest of the settings pages. */
.cp-manage h3 {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #111827;
}

.cp-manage h4,
.cp-manage h5 {
    margin: 1.25rem 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.cp-manage p {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.cp-manage hr {
    margin: 1rem 0;
    border-color: #e5e7eb;
    opacity: 1;
}

/* Bootstrap modals inside the hub pages (day closure preview, SMTP prompt) keep readable titles. */
.cp-hub .modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
}

.cp-hub .modal h5,
.cp-hub .modal h6 {
    font-weight: 600;
}

.cp-hub .modal p {
    margin: 0 0 0.75rem;
}
