/**
 * NeoHpl MedTech - Base Styles
 * ============================
 * Reset, normalize, and base element styles
 */

/* ========================================
   CSS RESET & NORMALIZE
======================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--color-dark);
    background-color: var(--color-white);
    overflow-x: hidden;
}

/* Prevent body scroll when modal is open */
body.modal-open,
body.menu-open {
    overflow: hidden;
}

/* ========================================
   TYPOGRAPHY
======================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-dark);
    margin-bottom: 0.5em;
}

h1 {
    font-size: var(--text-5xl);
}

h2 {
    font-size: var(--text-4xl);
}

h3 {
    font-size: var(--text-3xl);
}

h4 {
    font-size: var(--text-2xl);
}

h5 {
    font-size: var(--text-xl);
}

h6 {
    font-size: var(--text-lg);
}

p {
    margin-bottom: 1em;
    color: var(--color-gray-600);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition-colors);
}

a:hover {
    color: var(--color-primary-dark);
}

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

em, i {
    font-style: italic;
}

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

/* ========================================
   LISTS
======================================== */

ul, ol {
    list-style: none;
}

ul.styled-list,
ol.styled-list {
    padding-left: 1.5em;
}

ul.styled-list {
    list-style-type: disc;
}

ol.styled-list {
    list-style-type: decimal;
}

ul.styled-list li,
ol.styled-list li {
    margin-bottom: 0.5em;
    color: var(--color-gray-600);
}

/* ========================================
   IMAGES & MEDIA
======================================== */

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

img {
    border-style: none;
}

figure {
    margin: 0;
}

figcaption {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    margin-top: var(--space-2);
}

/* ========================================
   FORMS
======================================== */

button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
    font-size: 100%;
    line-height: var(--leading-normal);
    margin: 0;
}

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

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

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: var(--input-padding-y) var(--input-padding-x);
    border: 1px solid var(--input-border-color);
    border-radius: var(--input-border-radius);
    background-color: var(--color-white);
    transition: var(--transition-all);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--input-focus-border-color);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--color-gray-400);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

label {
    display: block;
    font-weight: var(--font-medium);
    margin-bottom: var(--space-2);
    color: var(--color-dark);
}

/* ========================================
   TABLES
======================================== */

table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}

th,
td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-gray-200);
}

th {
    font-weight: var(--font-semibold);
    background-color: var(--color-gray-50);
}

/* ========================================
   HORIZONTAL RULE
======================================== */

hr {
    border: 0;
    border-top: 1px solid var(--color-gray-200);
    margin: var(--space-8) 0;
}

/* ========================================
   SELECTION
======================================== */

::selection {
    background-color: var(--color-primary);
    color: var(--color-white);
}

::-moz-selection {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* ========================================
   SCROLLBAR
======================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--color-gray-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-500);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-gray-400) var(--color-gray-100);
}

/* ========================================
   ACCESSIBILITY
======================================== */

/* 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;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    z-index: var(--z-toast);
    transition: var(--transition-base);
}

.skip-link:focus {
    top: var(--space-2);
}

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@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;
    }
}
