/* ============================================================
   DS-APPLE — Base Styles & Reset
   ============================================================ */

/* 1. Box Model Universal */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

/* 3. Corpo */
body {
    font-family: var(--font-text);
    font-size: var(--text-body-lg);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-body);
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 4. Tipografia base */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-title);
    letter-spacing: var(--letter-spacing-tight);
    color: var(--color-text-primary);
}

p {
    max-width: 70ch;
    color: var(--color-text-secondary);
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--duration-base) var(--ease-default);
}

a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* 5. Imagens */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* 6. Formulários */
input,
button,
textarea,
select {
    font: inherit;
}

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

/* 7. Listas */
ul,
ol {
    list-style: none;
}

/* 8. Tabelas */
table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

/* 9. Acessibilidade — Foco visível */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* 10. Animação reduzida */
@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;
    }
}

/* 11. Seleção de texto */
::selection {
    background-color: rgba(0, 113, 227, 0.2);
    color: var(--color-text-primary);
}

/* 12. Scrollbar customizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--color-border-light);
    border-radius: var(--radius-pill);
}

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

/* 13. Modo escuro — detecção automática */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg-primary: #000000;
        --color-bg-secondary: #1c1c1e;
        --color-bg-card: #1c1c1e;
        --color-bg-nav: rgba(29, 29, 31, 0.85);
        --color-text-primary: #f5f5f7;
        --color-text-secondary: #a1a1a6;
        --color-text-tertiary: #6e6e73;
        --color-border-light: #424245;
        --color-divider: rgba(255, 255, 255, 0.1);
        --color-accent: #2997ff;
        --color-accent-hover: #30a0ff;
        --shadow-card: 0 2px 20px rgba(0, 0, 0, 0.4);
        --shadow-card-hover: 0 8px 40px rgba(0, 0, 0, 0.6);
    }

    body {
        color: var(--color-text-primary);
        background-color: var(--color-bg-primary);
    }

    h1,
    h2,
    h3,
    h4,
    h5,
    h6 {
        color: var(--color-text-primary);
    }
}

/* 14. Classe utilitária para forçar modo escuro */
.ds-dark {
    --color-bg-primary: #000000;
    --color-bg-secondary: #1c1c1e;
    --color-bg-card: #1c1c1e;
    --color-bg-nav: rgba(29, 29, 31, 0.85);
    --color-text-primary: #f5f5f7;
    --color-text-secondary: #a1a1a6;
    --color-text-tertiary: #6e6e73;
    --color-border-light: #424245;
    --color-divider: rgba(255, 255, 255, 0.1);
    --color-accent: #2997ff;
    --color-accent-hover: #30a0ff;
}

/* 15. Utilitários rápidos */
.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;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.d-block {
    display: block;
}

.d-none {
    display: none;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.overflow-hidden {
    overflow: hidden;
}