﻿/* ==========================================================
   Volantes - Base Styles (Reset & Global)
   Tema Claro para Público CNH
   ========================================================== */

/* ========== CSS Reset ========== */

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

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

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

/* ========== Typography ========== */

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

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

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

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

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

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

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

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

/* ========== Links ========== */

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

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

a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ========== Lists ========== */

ul,
ol {
    list-style: none;
}

/* ========== Images & Media ========== */

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

/* ========== Form Elements ========== */

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

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

input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: none;
}

/* ========== Tables ========== */

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

/* ========== Utility Classes ========== */

.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;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-success {
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

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

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

.text-primary {
    color: var(--color-text-primary);
}

.text-secondary {
    color: var(--color-text-secondary);
}

.text-tertiary {
    color: var(--color-text-tertiary);
}

.text-success {
    color: var(--color-success);
}

.text-warning {
    color: var(--color-warning);
}

.text-error {
    color: var(--color-error);
}

.text-brand {
    color: var(--color-primary);
}

.font-light {
    font-weight: var(--font-light);
}

.font-regular {
    font-weight: var(--font-regular);
}

.font-medium {
    font-weight: var(--font-medium);
}

.font-semibold {
    font-weight: var(--font-semibold);
}

.font-bold {
    font-weight: var(--font-bold);
}

/* ========== Flex Utilities ========== */

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

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

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-1 {
    gap: var(--space-1);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

/* ========== Grid Utilities ========== */

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ========== Spacing Utilities ========== */

.m-auto {
    margin: auto;
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-8 {
    margin-top: var(--space-8);
}

.p-2 {
    padding: var(--space-2);
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

.p-8 {
    padding: var(--space-8);
}

/* ========== Display Utilities ========== */

.hidden {
    display: none;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

/* ========== Width Utilities ========== */

.w-full {
    width: 100%;
}

.max-w-sm {
    max-width: var(--container-sm);
}

.max-w-md {
    max-width: var(--container-md);
}

.max-w-lg {
    max-width: var(--container-lg);
}

.max-w-xl {
    max-width: var(--container-xl);
}

/* ========== Animation Keyframes ========== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes progressPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 173, 92, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(46, 173, 92, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 173, 92, 0);
    }
}

.animate-fadeIn {
    animation: fadeIn var(--transition-normal) forwards;
}

.animate-fadeInUp {
    animation: fadeInUp var(--transition-slow) forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-progress-pulse {
    animation: progressPulse 2s infinite;
}

/* ========== Selection Styling ========== */

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

/* ========== Auth Protection (CSS-First Security) ========== */

/* Conteúdo protegido: invisível por padrão até autenticação */
.auth-protected {
    visibility: hidden;
    opacity: 0;
}

.auth-protected.authenticated {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Tela de loading de autenticação */
.auth-loading-screen {
    position: fixed;
    inset: 0;
    background: var(--color-bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.auth-loading-screen.hidden {
    display: none;
}

.auth-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.auth-loading-text {
    margin-top: var(--space-4);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
}

/* Fallback noscript styling */
noscript .auth-noscript-message {
    position: fixed;
    inset: 0;
    background: var(--color-bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: var(--space-6);
    text-align: center;
}

noscript .auth-noscript-message h2 {
    color: var(--color-error);
    margin-bottom: var(--space-4);
}

noscript .auth-noscript-message p {
    max-width: 400px;
}