:root {
    /* Base */
    --black: #030304;
    --black-soft: #0a0a0d;
    --white: #f6f5f8;
    --grey: #9a97a6;
    --grey-dim: #63606e;

    /* Roxo */
    --purple: #8b5cf6;
    --purple-bright: #b09bff;
    --purple-deep: #4c2a99;

    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.045);
    --glass-bg-hover: rgba(255, 255, 255, 0.075);
    --glass-border: rgba(255, 255, 255, 0.09);
    --glass-border-hover: rgba(176, 155, 255, 0.35);

    --radius: 18px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--black);
    color: var(--white);
    min-height: 100vh;
    padding-bottom: 80px;
    position: relative;
    overflow-x: hidden;
}

h1, h2, .counter-number, .header-eyebrow {
    font-family: 'Sora', sans-serif;
}

/* ---------- Ambiente ---------- */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
}

.ambient-glow--one {
    width: 480px;
    height: 480px;
    top: -180px;
    left: -120px;
    background: var(--purple-deep);
    animation: drift 22s ease-in-out infinite alternate;
}

.ambient-glow--two {
    width: 420px;
    height: 420px;
    bottom: -160px;
    right: -100px;
    background: var(--purple);
    opacity: 0.22;
    animation: drift 26s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(40px, 30px) scale(1.08); }
}

/* ---------- Header (Otimizado e Compacto) ---------- */
.header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(6, 6, 9, 0.65);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid var(--glass-border);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-eyebrow {
    display: inline-block;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--purple-bright);
    margin-bottom: 2px;
    font-weight: 600;
}

.header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
}

.header h1 .highlight {
    background: linear-gradient(135deg, var(--purple-bright), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-text p {
    color: var(--grey);
    margin-top: 2px;
    font-size: 0.82rem;
    font-weight: 300;
}

/* Contador horizontal moderno e discreto */
.header-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.counter-number {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--purple-bright);
    line-height: 1;
}

.counter-label {
    font-size: 0.65rem;
    color: var(--grey);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0;
}

/* ---------- Layout ---------- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    position: relative;
    z-index: 1;
}

.wall-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.empty-state {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
    color: var(--grey-dim);
}

.empty-state.visible {
    display: flex;
}

.empty-icon {
    font-size: 1.6rem;
    color: var(--purple);
    margin-bottom: 12px;
}

.empty-state p {
    max-width: 320px;
    font-weight: 300;
    font-size: 0.92rem;
}

/* ---------- Login ---------- */
.login-screen {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(3, 3, 4, 0.4);
}

html.authenticated .login-screen {
    display: none;
}

.app-content {
    display: none;
}

html.authenticated .app-content {
    display: block;
}

.login-card {
    width: 100%;
    max-width: 380px;
    text-align: center;
    background: rgba(14, 13, 18, 0.65);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    animation: popIn 0.35s var(--ease);
}

.login-card.shake {
    animation: shake 0.4s var(--ease);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.login-card .header-eyebrow {
    display: block;
    margin-bottom: 10px;
}

.login-card h2 {
    font-weight: 600;
    font-size: 1.4rem;
    color: var(--white);
}

.login-card > p {
    color: var(--grey);
    font-size: 0.9rem;
    font-weight: 300;
    margin-top: 10px;
}

#login-form {
    margin-top: 22px;
}

#login-password {
    width: 100%;
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--white);
    border-radius: 10px;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

#login-password::placeholder {
    color: var(--grey-dim);
}

#login-password:focus {
    border-color: var(--purple);
    background: rgba(139, 92, 246, 0.06);
}

.login-error {
    min-height: 18px;
    margin-top: 10px !important;
    font-size: 0.8rem;
    color: var(--purple-bright);
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s var(--ease);
}

.login-error.visible {
    opacity: 1;
}

/* ---------- Card ---------- */
.note-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    animation: fadeIn 0.5s var(--ease) forwards;
    transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

.note-card:hover {
    transform: translateY(-4px);
    background: var(--glass-bg-hover);
    border-color: var(--glass-border-hover);
    box-shadow: 0 16px 34px rgba(139, 92, 246, 0.18);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 10px;
}

.author-name {
    font-weight: 600;
    color: var(--white);
    font-size: 0.95rem;
}

.category-tag {
    font-size: 0.72rem;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: var(--purple-bright);
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.card-body {
    color: #d8d6e0;
    font-size: 0.95rem;
    line-height: 1.55;
    font-weight: 300;
    word-break: break-word;
}

.card-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--grey-dim);
}

.like-btn {
    background: none;
    border: none;
    color: var(--grey);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}

.like-btn:hover {
    color: var(--purple-bright);
    transform: scale(1.06);
}

.like-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    transition: transform 0.35s var(--ease), color 0.2s var(--ease);
}

.like-btn:active .like-icon {
    transform: scale(0.85);
}

.like-btn.liked {
    color: var(--purple-bright);
}

.like-btn.liked .like-icon {
    animation: likePulse 0.4s var(--ease);
}

@keyframes likePulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* ---------- FAB ---------- */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 58px;
    height: 58px;
    background: rgba(139, 92, 246, 0.16);
    border: 1px solid rgba(176, 155, 255, 0.4);
    color: var(--white);
    border-radius: 50%;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 28px rgba(139, 92, 246, 0.35);
    transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
    z-index: 40;
}

.fab:hover {
    background: rgba(139, 92, 246, 0.28);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 34px rgba(139, 92, 246, 0.45);
}

/* ---------- Modal ---------- */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(3, 3, 4, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: rgba(14, 13, 18, 0.75);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    padding: 32px;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    border: 1px solid var(--glass-border);
    position: relative;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    animation: popIn 0.3s var(--ease);
}

.modal-content h2 {
    font-weight: 600;
    font-size: 1.3rem;
}

.close {
    position: absolute;
    right: 20px; top: 16px;
    font-size: 22px;
    cursor: pointer;
    color: var(--grey);
    transition: color 0.2s var(--ease);
}

.close:hover {
    color: var(--white);
}

#note-form input, #note-form select, #note-form textarea {
    width: 100%;
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--white);
    border-radius: 10px;
    outline: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

#note-form input::placeholder, #note-form textarea::placeholder {
    color: var(--grey-dim);
}

#note-form input:focus, #note-form select:focus, #note-form textarea:focus {
    border-color: var(--purple);
    background: rgba(139, 92, 246, 0.06);
}

.btn-send {
    width: 100%;
    margin-top: 18px;
    padding: 13px;
    background: linear-gradient(135deg, var(--purple), var(--purple-deep));
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(139, 92, 246, 0.35);
}

/* ---------- Animações ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.94) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- Responsivo Otimizado ---------- */
@media (max-width: 560px) {
    .header-inner {
        padding: 10px 16px;
        gap: 10px;
    }

    .header h1 {
        font-size: 1.15rem;
    }

    .header-text p {
        display: none;
    }

    .header-counter {
        padding: 4px 10px;
    }

    .counter-number {
        font-size: 0.95rem;
    }

    .counter-label {
        font-size: 0.6rem;
    }
}

/* ---------- Acessibilidade ---------- */
@media (prefers-reduced-motion: reduce) {
    .ambient-glow,
    .note-card,
    .fab,
    .like-btn,
    .btn-send {
        animation: none !important;
        transition: none !important;
    }
}


