/* ============================================================
   TÊNIS 360 GRAUS — BASE STYLES
   ============================================================ */

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

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

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    transition: background-color var(--transition-slow), color var(--transition-slow);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   TIPOGRAFIA
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.1;
    letter-spacing: 0.02em;
    color: var(--color-text);
}

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-md); }

p {
    color: var(--color-text-secondary);
    line-height: 1.7;
}

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

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

strong {
    font-weight: 600;
    color: var(--color-text);
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    font-family: var(--font-body);
    border: none;
    background: none;
}

input, textarea, select {
    font-family: var(--font-body);
    font-size: var(--text-base);
}

ul, ol {
    list-style: none;
}

/* ============================================================
   CONTAINER
   ============================================================ */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

@media (max-width: 640px) {
    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
}

/* ============================================================
   NAVBAR
   ============================================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    z-index: var(--z-sticky);
    transition: background-color var(--transition-slow), border-color var(--transition-slow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
}

.navbar.scrolled {
    background: rgba(255,255,255,0.95);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .navbar.scrolled {
    background: rgba(15, 26, 18, 0.95);
}

.navbar__inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 100%;
}

.navbar__logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--color-text);
    letter-spacing: 0.05em;
}

.navbar__logo-icon {
    width: 36px;
    height: 36px;
    background: var(--color-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.navbar__links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
}

.navbar__links a {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
    position: relative;
}

.navbar__links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-primary);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.navbar__links a:hover,
.navbar__links a.active {
    color: var(--color-primary);
}

.navbar__links a:hover::after,
.navbar__links a.active::after {
    transform: scaleX(1);
}

.navbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
}

.navbar__hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 28px;
    padding: var(--space-2);
    cursor: pointer;
}

.navbar__hamburger span {
    display: block;
    height: 2px;
    background: var(--color-text);
    transition: all var(--transition-base);
    border-radius: 2px;
}

/* ============================================================
   BOTÕES
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.625rem var(--space-5);
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    letter-spacing: 0.01em;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn--primary {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.btn--primary:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    box-shadow: var(--shadow-primary);
    transform: translateY(-1px);
    color: white;
}

.btn--primary:active {
    transform: translateY(0);
}

.btn--outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn--outline:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-1px);
}

.btn--ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: transparent;
}

.btn--ghost:hover {
    background: var(--color-surface-2);
    color: var(--color-text);
}

.btn--danger {
    background: var(--color-error);
    color: white;
    border-color: var(--color-error);
}

.btn--danger:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
    color: white;
}

.btn--sm {
    padding: 0.375rem var(--space-4);
    font-size: var(--text-xs);
}

.btn--lg {
    padding: 0.875rem var(--space-8);
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
}

.btn--icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* Loader no botão */
.btn.loading .btn__text { opacity: 0; }
.btn.loading .btn__spinner { display: block; }

.btn__spinner {
    display: none;
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ============================================================
   FORMULÁRIOS
   ============================================================ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0.01em;
}

.form-label .required {
    color: var(--color-error);
    margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem var(--space-4);
    font-size: var(--text-base);
    color: var(--color-text);
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-slow);
    outline: none;
    line-height: 1.5;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-muted);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: var(--color-primary-light);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-accent-dim);
    background: var(--color-surface);
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: var(--color-error);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

.form-error {
    font-size: var(--text-xs);
    color: var(--color-error);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    min-height: 18px;
}

.form-hint {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    appearance: none;
    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='%234a5c50' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    cursor: pointer;
}

/* Input password toggle */
.input-password-wrapper {
    position: relative;
}

.input-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    padding: var(--space-1);
}

.input-password-toggle:hover {
    color: var(--color-primary);
}

/* Password strength */
.password-strength {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.password-strength__bars {
    display: flex;
    gap: var(--space-1);
}

.password-strength__bar {
    flex: 1;
    height: 4px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    transition: background var(--transition-base);
}

.password-strength__bar.active.weak { background: var(--color-error); }
.password-strength__bar.active.fair { background: var(--color-warning); }
.password-strength__bar.active.strong { background: var(--color-success); }

.password-strength__label {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-border-subtle);
}

.card__cover {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--color-surface-2);
}

.card__body {
    padding: var(--space-5);
}

.card__tag {
    display: inline-flex;
    align-items: center;
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--color-primary-subtle);
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-3);
}

.card__title {
    font-size: var(--text-lg);
    color: var(--color-text);
    margin-bottom: var(--space-2);
}

.card__description {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   BADGES & TAGS
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    letter-spacing: 0.04em;
}

.badge--success { background: var(--color-success-subtle); color: var(--color-success); }
.badge--warning { background: var(--color-warning-subtle); color: var(--color-warning); }
.badge--error   { background: var(--color-error-subtle); color: var(--color-error); }
.badge--info    { background: var(--color-info-subtle); color: var(--color-info); }
.badge--primary { background: var(--color-primary-subtle); color: var(--color-primary); }

/* ============================================================
   PROGRESS BAR
   ============================================================ */

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--color-surface-3);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* ============================================================
   SKELETON LOADING
   ============================================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-surface-2) 25%,
        var(--color-surface-3) 50%,
        var(--color-surface-2) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   TOAST / ALERTAS
   ============================================================ */

.toast-container {
    position: fixed;
    top: calc(var(--navbar-height) + var(--space-4));
    right: var(--space-4);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    max-width: 360px;
    width: 100%;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    pointer-events: all;
    animation: toast-enter 0.35s var(--transition-spring) both;
    border-left: 4px solid currentColor;
}

.toast.success { color: var(--color-success); }
.toast.error   { color: var(--color-error); }
.toast.warning { color: var(--color-warning); }
.toast.info    { color: var(--color-info); }

.toast.leaving {
    animation: toast-leave 0.3s ease forwards;
}

.toast__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.toast__content {
    flex: 1;
}

.toast__title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

.toast__message {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    margin-top: 2px;
    line-height: 1.5;
}

.toast__close {
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
    flex-shrink: 0;
    padding: 2px;
}

.toast__close:hover {
    color: var(--color-text);
}

@keyframes toast-enter {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes toast-leave {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(110%); opacity: 0; }
}

/* ============================================================
   MODAL
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2xl);
    max-width: 560px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95) translateY(8px);
    transition: transform var(--transition-spring);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.open .modal {
    transform: scale(1) translateY(0);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.modal__title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    color: var(--color-text);
    letter-spacing: 0.03em;
}

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

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-6);
    border-top: 1px solid var(--color-border);
}

.modal__icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-xl);
    background: var(--color-surface-2);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: var(--space-6) auto var(--space-4);
    flex-shrink: 0;
}

.modal__icon svg { width: 24px; height: 24px; }

.modal__icon--danger { background: var(--color-error-subtle); color: var(--color-error); }
.modal__icon--warning { background: var(--color-warning-subtle); color: var(--color-warning); }
.modal__icon--success { background: var(--color-success-subtle); color: var(--color-success); }

.modal__text {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    padding: 0 var(--space-6) var(--space-4);
}

.modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6) var(--space-6);
}

.modal--centered { text-align: center; }
.modal--centered .modal__title { padding: 0 var(--space-6); }
.modal--centered .modal__actions { justify-content: center; }

.modal__thumb {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    flex-shrink: 0;
    background-color: var(--color-surface-2);
}

.modal--enroll .modal__thumb {
    height: 240px;
    position: relative;
    display: flex;
    align-items: flex-end;
    margin: var(--space-3) var(--space-3) 0;
    width: auto;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.modal--enroll .modal__thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,0.72) 100%);
    border-radius: var(--radius-xl);
    pointer-events: none;
}

.modal__close-overlay {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    border: 1.5px solid rgba(255,255,255,0.25);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.modal__close-overlay:hover {
    background: rgba(0,0,0,0.65);
}

.modal__thumb-footer {
    position: relative;
    z-index: 1;
    padding: var(--space-4) var(--space-5);
    width: 100%;
}

.modal--enroll .modal__title {
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    margin: 0;
}

.modal--enroll .modal__body {
    padding: var(--space-4) var(--space-5);
}

.modal--enroll .modal__footer {
    padding: var(--space-4) var(--space-5);
}

.enroll-desc {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-3);
}

.enroll-desc:empty {
    display: none;
}

.enroll-cta {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-3);
}

/* ============================================================
   DROPDOWN
   ============================================================ */

.dropdown {
    position: relative;
}

.dropdown__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: all var(--transition-base);
}

.dropdown.open .dropdown__menu {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    border: none;
    background: none;
    font-family: var(--font-body);
    text-align: left;
}

.dropdown__item:hover {
    background: var(--color-surface-2);
    color: var(--color-text);
}

.dropdown__item.danger {
    color: var(--color-error);
}

.dropdown__item.danger:hover {
    background: var(--color-error-subtle);
}

.dropdown__divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-1) 0;
}

/* ============================================================
   THEME TOGGLE
   ============================================================ */

.theme-toggle {
    width: 44px;
    height: 24px;
    background: var(--color-surface-3);
    border-radius: var(--radius-full);
    border: 1.5px solid var(--color-border);
    position: relative;
    cursor: pointer;
    transition: background var(--transition-base);
}

.theme-toggle::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--color-primary);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform var(--transition-spring);
}

[data-theme="dark"] .theme-toggle::after {
    transform: translateX(20px);
}

/* ============================================================
   SIDEBAR (ADMIN)
   ============================================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: var(--navbar-height);
    bottom: 0;
    width: 260px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    padding: var(--space-6);
    overflow-y: auto;
    transition: all var(--transition-base);
    z-index: var(--z-above);
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.sidebar__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.sidebar__item:hover {
    background: var(--color-surface-2);
    color: var(--color-text);
}

.sidebar__item.active {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
}

.sidebar__section-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: var(--space-5) 0 var(--space-2) var(--space-4);
}

/* ============================================================
   TABELA ADMINISTRATIVA
   ============================================================ */

.table-wrapper {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table th {
    background: var(--color-surface-2);
    padding: var(--space-4) var(--space-5);
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.table td {
    padding: var(--space-4) var(--space-5);
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border-subtle);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover td {
    background: var(--color-surface-2);
}

/* ============================================================
   ANIMATIONS UTILITÁRIAS
   ============================================================ */

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

.animate-fade-in { animation: fadeIn var(--transition-base) both; }
.animate-slide-up { animation: slideUp var(--transition-base) both; }

/* ============================================================
   UTILITÁRIOS
   ============================================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--color-text-muted); }
.text-primary { color: var(--color-primary); }
.text-error  { color: var(--color-error); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.w-full { width: 100%; }
.mt-4  { margin-top: var(--space-4); }
.mb-4  { margin-bottom: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.mb-6  { margin-bottom: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }

.hidden { display: none !important; }
.invisible { visibility: hidden; }

/* ============================================================
   RESPONSIVIDADE
   ============================================================ */

@media (max-width: 768px) {
    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
    h3 { font-size: var(--text-xl); }

    .navbar__inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .navbar__links { display: none; }
    .navbar__hamburger { display: flex; }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: var(--z-overlay);
    }

    .sidebar.open {
        transform: translateX(0);
    }
}

@media (max-width: 480px) {
    :root {
        --text-4xl: 2.5rem;
        --text-3xl: 2rem;
    }

    .toast-container {
        left: var(--space-4);
        right: var(--space-4);
        max-width: none;
    }
}

/* ============================================================
   SETTINGS MODAL
   ============================================================ */

.settings-modal {
    max-width: 460px;
}

.settings-modal__body {
    padding: 0;
}

.settings-section {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.settings-section--last {
    border-bottom: none;
}

.settings-section__title {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.settings-row__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-row__label {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text);
}

.settings-row__desc {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.settings-theme-options {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
}

.settings-theme-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    background: var(--color-surface-2);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-body);
    white-space: nowrap;
}

.settings-theme-btn:hover {
    background: var(--color-surface-3);
    color: var(--color-text);
}

.settings-theme-btn.active {
    background: var(--color-primary-subtle);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* Keyboard shortcuts */
.settings-shortcuts {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.shortcut-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
}

.shortcut-row span {
    color: var(--color-text-secondary);
    margin-left: var(--space-1);
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    min-width: 28px;
    font-size: var(--text-xs);
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--color-text);
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-bottom-width: 2px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

/* About section */
.settings-about {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.settings-about__logo {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.settings-about__logo-text {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    color: var(--color-text);
    letter-spacing: 0.05em;
}

.settings-about__logo-badge {
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    color: var(--color-primary);
    background: var(--color-primary-subtle);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.02em;
}

.settings-about__desc {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

.settings-about__version {
    display: inline-block;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-weight: 500;
    font-family: var(--font-body);
}

.settings-section--danger {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
}

.settings-logout-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-error);
    background: transparent;
    border: 1.5px solid var(--color-error);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: var(--font-body);
    width: 100%;
    justify-content: center;
}

.settings-logout-btn:hover {
    background: var(--color-error-subtle);
}

/* ============================================================
   LOGOUT CONFIRMATION (within settings modal)
   ============================================================ */

.settings-logout-confirm {
    padding: var(--space-2) 0;
    text-align: center;
}

.settings-logout-confirm p {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-4);
}

.settings-logout-confirm__actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}

/* ============================================================
   PAGE LOADING OVERLAY & SPINNER
   ============================================================ */

/* Page loading overlay */
.page-loading {
    position: fixed; inset: 0;
    background: var(--color-bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}
.page-loading.done { opacity: 0; pointer-events: none; }

.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.spinner--sm { width: 20px; height: 20px; border-width: 2px; }
.spinner--lg { width: 56px; height: 56px; border-width: 4px; }
