/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Poppins:wght@400;500;600&display=swap');

/* ===== BASE ===== */
* {
    box-sizing: border-box;
}

/* ===== BODY ===== */
body {
    font-family: 'Poppins', Arial, sans-serif;
    background: linear-gradient(135deg, #1A1A2E 0%, #2D1B69 50%, #1A1A2E 100%);
    background-attachment: fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px 16px;
}

/* ===== PARTICLES ===== */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    opacity: 0;
    animation: particle-fall linear infinite;
}

@keyframes particle-fall {
    0%   { transform: translateY(-20px) rotate(0deg);   opacity: 0.9; }
    80%  { opacity: 0.4; }
    100% { transform: translateY(102vh) rotate(720deg); opacity: 0; }
}

/* ===== CONTAINER ===== */
.container {
    background: white;
    padding: 2rem;
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(108, 58, 224, 0.4);
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Animated rainbow top border */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #6C3AE0, #FF6B6B, #FFD93D, #6C3AE0);
    background-size: 200% 100%;
    animation: gradient-shift 3s linear infinite;
}

@keyframes gradient-shift {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* ===== HIDDEN ===== */
.hidden {
    display: none;
}

/* ===== TYPOGRAPHY ===== */
h1 {
    font-family: 'Fredoka One', cursive;
    font-size: 2.6rem;
    text-align: center;
    margin: 0 0 1.5rem;
    line-height: 1.1;
    background: linear-gradient(135deg, #6C3AE0, #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-family: 'Fredoka One', cursive;
    font-size: 1.7rem;
    color: #6C3AE0;
    text-align: center;
    margin: 0 0 1.25rem;
    line-height: 1.2;
}

h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    color: #6C3AE0;
    font-weight: 600;
    margin: 0 0 0.75rem;
}

p {
    color: #666;
    font-size: 0.9rem;
    text-align: center;
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

a {
    color: #6C3AE0;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #FF6B6B;
    text-decoration: underline;
}

/* ===== LOGIN ICON ANIMATION ===== */
.login-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: -0.25rem;
    display: block;
    animation: bounce 2.5s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}

.login-subtitle {
    color: #999;
    font-size: 0.85rem;
    text-align: center;
    margin-top: -1rem;
    margin-bottom: 1.25rem;
}

.login-links {
    text-align: center;
    margin-top: 6px;
}

.login-links p {
    margin: 6px 0;
    font-size: 0.88rem;
}

/* ===== HOME SUBTITLE ===== */
.home-subtitle {
    color: #aaa;
    font-size: 0.85rem;
    margin-top: -0.9rem;
    margin-bottom: 1.25rem;
}

/* ===== FIELD LABELS ===== */
.field-label {
    display: block;
    text-align: left;
    margin: 12px 0 4px;
    color: #6C3AE0;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* ===== INPUTS ===== */
input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    margin: 6px 0;
    border: 2px solid #EDE8FF;
    border-radius: 12px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    background: #FAFAFA;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
    color: #333;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #6C3AE0;
    box-shadow: 0 0 0 4px rgba(108, 58, 224, 0.12);
    background: white;
}

input.invalid {
    border-color: #FF6B6B;
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.12);
    background: #FFF8F8;
}

/* Large token input */
.token-input {
    text-align: center;
    font-size: 1.8rem;
    letter-spacing: 8px;
    font-weight: 700;
    color: #6C3AE0;
    font-family: 'Fredoka One', cursive;
}

/* ===== BUTTONS ===== */
button {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, #6C3AE0 0%, #8B5CF6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 10px;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    letter-spacing: 0.2px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108, 58, 224, 0.4);
}

button:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Secondary (back/cancel) */
.btn-secondary {
    background: #F0EBFF;
    color: #6C3AE0;
    box-shadow: none;
}

.btn-secondary:hover {
    background: #E4D9FF;
    box-shadow: 0 4px 12px rgba(108, 58, 224, 0.15);
    transform: translateY(-1px);
}

/* Gray */
.btn-gray {
    background: linear-gradient(135deg, #6c757d, #868e96);
}

.btn-gray:hover {
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.3);
}

/* Danger (red) */
.btn-danger {
    background: linear-gradient(135deg, #FF6B6B, #dc3545);
}

.btn-danger:hover {
    box-shadow: 0 8px 24px rgba(255, 107, 107, 0.4);
}

/* Teal */
.btn-teal {
    background: linear-gradient(135deg, #17a2b8, #20c997);
}

.btn-teal:hover {
    box-shadow: 0 8px 24px rgba(23, 162, 184, 0.4);
}

/* Gold (completion actions) */
.btn-gold {
    background: linear-gradient(135deg, #f0a500, #FFD93D);
    color: #1A1A2E;
}

.btn-gold:hover {
    box-shadow: 0 8px 24px rgba(255, 217, 61, 0.5);
}

/* ===== BUTTON GROUPS ===== */
.buttons {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

/* ===== DASHBOARD ACTIONS ===== */
.dashboard-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ===== ERROR MESSAGE ===== */
.error {
    color: #c0392b;
    background: linear-gradient(135deg, #FFF0F0, #FFE8E8);
    border: 1.5px solid #FFB3B3;
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 12px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===== CHECKBOXES ===== */
.checkbox-wrapper {
    margin: 15px 0;
    text-align: left;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
}

.checkbox-container input {
    width: auto;
    margin: 2px 0 0;
    accent-color: #6C3AE0;
    flex-shrink: 0;
}

/* ===== WIZARD PROGRESS BAR ===== */
.wizard-progress {
    display: flex;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.wizard-step-dot {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #EDE8FF;
    transition: background 0.4s ease;
}

.wizard-step-dot.active {
    background: linear-gradient(90deg, #6C3AE0, #FF6B6B);
}

.wizard-step-dot.done {
    background: #6C3AE0;
}

/* ===== ADD ITEM FORM ===== */
.add-item-form {
    background: linear-gradient(135deg, #F8F5FF, #FFF5F5);
    border: 1.5px solid #EDE8FF;
    border-radius: 16px;
    padding: 16px;
    margin: 12px 0;
}

/* ===== WARNING BOX ===== */
.warning-box {
    font-size: 0.82rem;
    color: #856404;
    background: linear-gradient(135deg, #fff8e1, #fff3cd);
    padding: 12px 14px;
    border-radius: 12px;
    border: 1.5px solid #FFE69C;
    margin-bottom: 15px;
    line-height: 1.5;
    text-align: left;
}

/* ===== SMALL NOTE ===== */
.small-note {
    font-size: 0.75rem;
    color: #999;
    margin: -4px 0 0 24px;
    line-height: 1.4;
    text-align: left;
}

/* ===== DIVIDER ===== */
.divider {
    border: 0;
    border-top: 1.5px solid #EDE8FF;
    margin: 20px 0;
}

/* ===== ITEM COUNT BADGE ===== */
.item-count-badge {
    font-size: 0.8rem;
    color: #8B5CF6;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

/* ===== CHAR COUNTER ===== */
.char-counter {
    text-align: right;
    font-size: 0.78rem;
    color: #aaa;
    margin-bottom: 10px;
    margin-top: -2px;
}

/* ===== SUCCESS SCREEN ===== */
.success-card {
    background: linear-gradient(135deg, #F0EBFF, #FFF0F5);
    border: 1.5px solid #EDE8FF;
    border-radius: 16px;
    padding: 24px 20px;
    margin: 12px 0;
    text-align: center;
}

.success-icon {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 8px;
    animation: bounce 2.5s ease-in-out infinite;
}

.list-id-badge {
    display: inline-block;
    background: linear-gradient(135deg, #6C3AE0, #8B5CF6);
    color: white;
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: 'Fredoka One', cursive;
    letter-spacing: 3px;
    margin-top: 8px;
    box-shadow: 0 4px 16px rgba(108, 58, 224, 0.35);
}

/* ===== LIST CARD (My Lists) ===== */
.list-card {
    border-bottom: 1.5px solid #EDE8FF;
    padding: 12px 0;
}

.list-card-header {
    font-size: 0.88rem;
    color: #555;
    font-weight: 500;
    margin: 0 0 8px;
    text-align: left;
}

.list-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ===== STATUS BADGE (Guest Lists) ===== */
.status-badge {
    display: inline-block; padding: 2px 10px; border-radius: 10px;
    font-size: 0.72rem; font-weight: 700;
}
.status-badge-active  { background: #d4f5e0; color: #27ae60; }
.status-badge-expired { background: #ffe0e0; color: #dc3545; }

/* ===== ITEM CARD (View List) ===== */
.item-card {
    border-bottom: 1.5px solid #EDE8FF;
    padding: 12px 0;
}

.item-card-info {
    font-size: 0.88rem;
    color: #444;
    margin: 0 0 8px;
    line-height: 1.5;
    text-align: left;
    word-break: break-word;
}

.item-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* Small compact buttons (used inside dynamic card lists) */
.btn-sm {
    width: auto !important;
    padding: 7px 14px !important;
    font-size: 0.8rem !important;
    margin: 0 !important;
    border-radius: 8px !important;
}

/* Qty input inside item cards */
.qty-input {
    width: 60px !important;
    margin: 0 !important;
    padding: 8px !important;
    font-size: 0.85rem !important;
}

/* Pix card */
.pix-card {
    background: linear-gradient(135deg, #d4f5e0, #e8f5e9);
    color: #155724;
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    border: 1.5px solid #a8d5b5;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ===== EVENT CARD (My Events list) ===== */
.event-card {
    border-bottom: 1.5px solid #EDE8FF;
    padding: 14px 0;
}

.event-card-header {
    font-size: 0.95rem;
    color: #333;
    font-weight: 600;
    margin: 0 0 10px;
    text-align: left;
}

.event-card-header small {
    color: #999;
    font-weight: 400;
    font-size: 0.8rem;
}

.event-card-meta {
    font-size: 0.78rem;
    color: #aaa;
    margin-bottom: 10px;
    text-align: left;
}

.event-card-expired {
    opacity: 0.7;
}

.event-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    vertical-align: middle;
    margin-left: 6px;
}

.event-badge-active {
    background: #e8f5e9;
    color: #27ae60;
    border: 1px solid #a8d5b5;
}

.event-badge-expired {
    background: #fce8e8;
    color: #c0392b;
    border: 1px solid #f5b3b3;
}

/* ===== CHECKLIST ITEM ===== */
.checklist-item {
    border-bottom: 1.5px solid #EDE8FF;
    padding: 14px 0;
}

.checklist-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    text-align: left;
}

.checklist-item-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Link row — vínculo de lista de presentes ao item do checklist */
.checklist-item-link {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-link-list {
    width: auto !important;
    padding: 5px 10px !important;
    font-size: 0.75rem !important;
    margin: 0 !important;
    background: #f0ebff;
    color: #6c3ee8;
    border: 1px solid #d6caff;
    border-radius: 6px;
    cursor: pointer;
}

.btn-link-list.btn-link-empty {
    background: transparent;
    color: #aaa;
    border-color: #ddd;
}

.btn-unlink-list {
    width: auto !important;
    padding: 3px 8px !important;
    font-size: 0.8rem !important;
    margin: 0 !important;
    background: transparent;
    color: #aaa;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.btn-unlink-list:hover { color: #dc3545; }

/* Status buttons — base (inativo) */
.btn-status {
    width: auto !important;
    padding: 7px 10px !important;
    font-size: 0.75rem !important;
    margin: 0 !important;
    border-radius: 20px !important;
    background: transparent !important;
    color: #888 !important;
    border: 1.5px solid #DDD !important;
    font-weight: 500 !important;
    box-shadow: none !important;
    transition: background 0.15s, color 0.15s, border-color 0.15s !important;
}

.btn-status:hover {
    background: #F5F0FF !important;
    border-color: #6C3AE0 !important;
    color: #6C3AE0 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Status buttons — ativo (selecionado) */
.btn-status.active-consegui {
    background: #27ae60 !important;
    color: white !important;
    border-color: #27ae60 !important;
}

.btn-status.active-pendente {
    background: #f39c12 !important;
    color: white !important;
    border-color: #f39c12 !important;
}

.btn-status.active-nao-preciso {
    background: #95a5a6 !important;
    color: white !important;
    border-color: #95a5a6 !important;
}

/* ===== SERVICES — DISTANCE BADGE & LOCATION STATUS ===== */
.distance-badge {
    display: inline-block;
    font-size: 0.72rem;
    color: #6C3AE0;
    background: #F0EBFF;
    padding: 2px 9px;
    border-radius: 20px;
    white-space: nowrap;
    font-weight: 600;
}

.location-status {
    font-size: 0.82rem;
    color: #666;
    padding: 6px 0 2px;
}
/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 46, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(26, 26, 46, 0.45);
    text-align: left;
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6C3AE0, #FF6B6B, #FFD93D);
    border-radius: 20px 20px 0 0;
}

.modal-body-text {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
    text-align: left;
}

.modal-body-text p {
    text-align: left;
}

/* --- Criador de Convites --- */
.bg-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.bg-option {
    flex: 1;
    padding: 10px 4px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    border: 2px solid transparent;
    transition: transform 0.15s;
    user-select: none;
}
.bg-option[data-bg="purple"] { background: linear-gradient(135deg, #6C3AE0, #8B5CF6); color: white; }
.bg-option[data-bg="gold"]   { background: linear-gradient(135deg, #f7971e, #ffd200); color: #333; }
.bg-option[data-bg="dark"]   { background: linear-gradient(135deg, #0f0c29, #302b63); color: white; }
.bg-option.active { border-color: #FF6B6B; transform: scale(1.05); }

.invite-preview {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.invite-preview img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 3px solid rgba(255,255,255,0.6);
}
.invite-preview h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: inherit;
}
.invite-preview p {
    font-size: 0.82rem;
    opacity: 0.9;
    margin: 0;
    white-space: pre-wrap;
    color: inherit;
}
.invite-brand {
    position: absolute;
    bottom: 10px;
    right: 14px;
    font-size: 0.68rem;
    opacity: 0.6;
}
.bg-purple { background: linear-gradient(135deg, #6C3AE0, #8B5CF6); color: white; }
.bg-gold   { background: linear-gradient(135deg, #f7971e, #ffd200); color: #222; }
.bg-dark   { background: linear-gradient(135deg, #0f0c29, #302b63, #24243e); color: white; }

/* --- Lista de Convidados --- */
.guests-summary {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.guests-summary-chip {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}
.chip-total      { background: #EDE8FF; color: #6C3AE0; }
.chip-confirmado { background: #d4f5e0; color: #27ae60; }
.chip-recusou    { background: #ffe0e0; color: #dc3545; }

.guests-group-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #6C3AE0;
    margin: 14px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.guest-card {
    background: white;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1.5px solid #EDE8FF;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.guest-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.guest-name { font-weight: 600; font-size: 0.9rem; color: #333; }
.guest-category-tag {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: #F0EBFF;
    color: #6C3AE0;
    font-weight: 600;
    white-space: nowrap;
}
.guest-rsvp-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.btn-rsvp {
    flex: 1;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    background: #F0EBFF;
    color: #666;
    border: 1.5px solid #EDE8FF;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 70px;
}
.btn-rsvp.active-confirmado { background: #d4f5e0; color: #27ae60; border-color: #27ae60; }
.btn-rsvp.active-pendente   { background: #fff3cd; color: #856404; border-color: #ffc107; }
.btn-rsvp.active-recusou    { background: #ffe0e0; color: #dc3545; border-color: #dc3545; }

/* ── Orçamento do evento ─────────────────────────────────── */
#event-budget-bar {
    background: #F7F4FF;
    border: 1.5px solid #E0D8FF;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.budget-bar-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 4px;
}
.budget-bar-labels strong { color: #333; }
.budget-ok   { color: #27ae60; font-weight: 600; }
.budget-over { color: #dc3545; font-weight: 600; }
.budget-track {
    width: 100%;
    height: 8px;
    background: #E0D8FF;
    border-radius: 99px;
    overflow: hidden;
}
.budget-fill {
    height: 100%;
    background: linear-gradient(90deg, #6C3AE0, #8B5CF6);
    border-radius: 99px;
    transition: width 0.3s;
}
.budget-fill-over { background: linear-gradient(90deg, #e04040, #ff6b6b); }
.budget-bar-sub {
    font-size: 0.75rem;
    color: #888;
    margin-top: 4px;
    text-align: right;
}
.budget-empty-hint {
    font-size: 0.85rem;
    color: #999;
    margin: 0 0 8px;
}
.budget-edit-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ddd;
}

/* ── Custo por item do checklist ─────────────────────────── */
.checklist-item-cost {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #eee;
}
.cost-input {
    flex: 1;
    padding: 6px 10px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #333;
    background: #fafafa;
    min-width: 0;
}
.cost-input:focus { border-color: #8B5CF6; outline: none; background: #fff; }
.btn-cost-save {
    padding: 6px 14px;
    font-size: 0.8rem;
    background: #6C3AE0;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    width: auto;
    margin: 0;
}
.btn-cost-save:hover { background: #5a2fc2; }
