/*
 * Xignifi Admin – minimal overrides for django-unfold.
 * Unfold handles all core styling via Tailwind.
 * Only add rules here that fix a specific visual gap.
 */

/* Global ND4 theme color overrides across login/admin actions. */
:root {
    --xig-theme-500: 117 86 231;
    --xig-theme-600: 107 77 227;
    --xig-theme-700: 100 69 223;
    --xig-theme-800: 83 58 185;
    --xig-theme-soft: 235 231 255;
}

body a {
    color: rgb(var(--xig-theme-700));
}

body a:hover,
body a:focus {
    color: rgb(var(--xig-theme-800));
}

body button[type="submit"],
body input[type="submit"],
body .button.default,
body .submit-row input.default,
body [class*="bg-primary"] {
    background-color: rgb(var(--xig-theme-700)) !important;
    border-color: rgb(var(--xig-theme-700)) !important;
}

body button[type="submit"]:hover,
body button[type="submit"]:focus,
body input[type="submit"]:hover,
body input[type="submit"]:focus,
body .button.default:hover,
body .button.default:focus,
body .submit-row input.default:hover,
body .submit-row input.default:focus,
body [class*="bg-primary"]:hover,
body [class*="bg-primary"]:focus {
    background-color: rgb(var(--xig-theme-800)) !important;
    border-color: rgb(var(--xig-theme-800)) !important;
}

body input:focus,
body textarea:focus,
body select:focus {
    border-color: rgb(var(--xig-theme-600));
    box-shadow: 0 0 0 2px rgba(var(--xig-theme-soft), 0.95);
    outline: none;
}

/* Form-field borders on change/add forms only (scoped to .change-form) */
body.change-form .form-row input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
body.change-form .form-row textarea,
body.change-form .form-row select {
    border: 1px solid rgb(var(--color-base-300));
    border-radius: 0.5rem;
}

body.change-form .form-row input:focus,
body.change-form .form-row textarea:focus,
body.change-form .form-row select:focus {
    border-color: rgb(var(--color-primary-500));
    box-shadow: 0 0 0 2px rgba(var(--color-primary-500), 0.12);
    outline: none;
}

/* Dark mode form-field borders */
@media (prefers-color-scheme: dark) {
    body.change-form .form-row input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
    body.change-form .form-row textarea,
    body.change-form .form-row select {
        border-color: rgb(var(--color-base-700));
    }
}
