/**
 * KSeF Invoice Tracker — Base Styles
 * Reset, typography, base elements
 */

/* ── Reset ────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Typography ───────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--weight-semibold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    text-decoration: underline;
}

strong, b {
    font-weight: var(--weight-semibold);
}

small {
    font-size: var(--text-sm);
}

code, pre {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

/* ── Lists ────────────────────────────────── */
ul, ol {
    list-style: none;
}

/* ── Images ───────────────────────────────── */
img, svg {
    display: block;
    max-width: 100%;
}

/* ── Tables — base ────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

/* ── Form elements — base ─────────────────── */
button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

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

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* Remove autofill styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0px 1000px var(--bg-surface) inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* ── Scrollbar ────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

/* ── Selection ────────────────────────────── */
::selection {
    background-color: var(--color-primary-light);
    color: var(--text-primary);
}

/* ── Utility: screen reader only ──────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
