/* ==========================================================================
   Nexoriss Finance — Base layer
   Modern reset (replaces Bootstrap Reboot) + base elements + form primitives.
   Consumes tokens from tokens.css. Mobile-first.
   ========================================================================== */

/* -- Reset ---------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-base);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
    margin: 0;
}

h1, h2, h3, h4 {
    line-height: var(--lh-tight);
    color: var(--text-strong);
    font-weight: 600;
}

h1 { font-size: var(--fs-2xl); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-xl); letter-spacing: -0.01em; }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

a {
    color: var(--brand-2);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

img, svg, video, canvas {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: var(--space-4) 0;
}

/* -- Forms: inherit font, sane defaults ----------------------------------- */
button, input, select, textarea, optgroup {
    font: inherit;
    color: inherit;
    margin: 0;
}

button {
    background: none;
    border: 0;
    cursor: pointer;
}

button:disabled,
[disabled] {
    cursor: not-allowed;
}

textarea {
    resize: vertical;
}

::placeholder {
    color: var(--input-placeholder);
    opacity: 1;
}

/* Base form control look (app.css overrides for themed variants remain valid).
   These ensure controls stay usable once Bootstrap is removed. */
.form-control,
.form-select,
.input,
.field,
input:where([type="text"], [type="email"], [type="password"], [type="number"],
             [type="search"], [type="date"], [type="tel"], [type="url"]),
select,
textarea {
    width: 100%;
    min-height: var(--touch-target);
    padding: 0.55rem 0.8rem;
    font-size: var(--fs-base);
    color: var(--text);
    background-color: var(--input-bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-select,
select {
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c6675' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1rem;
}

.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand-2);
    box-shadow: var(--focus-shadow);
}

.form-label {
    display: inline-block;
    margin-bottom: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--muted-strong);
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    min-height: 0;
    accent-color: var(--brand-2);
    cursor: pointer;
}

/* -- Accessible focus for interactive elements ---------------------------- */
:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* -- Base table ----------------------------------------------------------- */
table {
    border-collapse: collapse;
    width: 100%;
}

/* -- Minimal spacing helper still referenced in markup -------------------- */
.mb-3 { margin-bottom: var(--space-4); }

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