* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px #7c3aed, 0 0 10px #7c3aed; }
    50% { box-shadow: 0 0 20px #7c3aed, 0 0 40px #7c3aed, 0 0 60px #7c3aed; }
}

@keyframes nebula {
    0% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    33% { transform: translate(30px, -20px) scale(1.1); opacity: 0.4; }
    66% { transform: translate(-20px, 30px) scale(0.9); opacity: 0.2; }
    100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a1a;
    color: #e0e0ff;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

#stars-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.nebula {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
}

.nebula-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.15), transparent);
    top: -100px;
    right: -100px;
    animation: nebula 15s ease-in-out infinite;
}

.nebula-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1), transparent);
    bottom: -50px;
    left: -100px;
    animation: nebula 20s ease-in-out infinite reverse;
}

.nebula-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.08), transparent);
    top: 50%;
    left: 50%;
    animation: nebula 18s ease-in-out infinite 5s;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 40px 0 20px;
}

.logo {
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #7c3aed, #3b82f6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 8px;
    text-transform: uppercase;
    animation: float 4s ease-in-out infinite;
    position: relative;
    display: inline-block;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #7c3aed, transparent);
}

.tagline {
    color: #8888aa;
    font-size: 1rem;
    margin-top: 10px;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.main-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(10px);
    animation: glow 4s ease-in-out infinite;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #aaaacc;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.input-wrapper input:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}

.input-wrapper input::placeholder {
    color: #555577;
}

.btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: block;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(124, 58, 237, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: rotate(45deg);
    transition: 0.5s;
}

.btn:hover::after {
    left: 100%;
}

.error-msg {
    color: #ef4444;
    margin-top: 15px;
    font-size: 0.9rem;
    display: none;
}

.error-msg.show {
    display: block;
}

.project-links {
    text-align: center;
    margin-top: 30px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #8888aa;
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.project-link:hover {
    color: #7c3aed;
}

.project-icon {
    font-size: 1.2rem;
}

footer {
    text-align: center;
    padding: 40px 0;
    color: #444466;
    font-size: 0.8rem;
    letter-spacing: 2px;
}

/* Dashboard */
.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 25px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.user-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ccccee;
}

.user-email {
    font-size: 0.85rem;
    color: #8888aa;
    margin-top: 2px;
}

.user-type {
    margin-top: 8px;
}

.badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.badge-type {
    background: rgba(124, 58, 237, 0.15);
    color: #7c3aed;
}

.badge-admin {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.badge-silver {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

.badge-gold {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.badge-free {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.dash-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: #e0e0ff;
    transition: all 0.3s;
}

.dash-card:hover {
    transform: translateY(-5px);
    border-color: #7c3aed;
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.2);
}

.dash-card-admin {
    border-color: rgba(239, 68, 68, 0.2);
}

.dash-card-admin:hover {
    border-color: #ef4444;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.2);
}

.dash-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.dash-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.dash-desc {
    font-size: 0.8rem;
    color: #8888aa;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .logo {
        font-size: 2.5rem;
        letter-spacing: 5px;
    }

    .main-card {
        padding: 25px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .user-info {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container { padding: 12px; }
    header { padding: 20px 0 10px; }
    .logo { font-size: 1.8rem; letter-spacing: 4px; }
    .tagline { font-size: 0.8rem; letter-spacing: 2px; }

    .main-card { padding: 20px; }
    .form-group label { font-size: 0.75rem; letter-spacing: 1px; }
    .input-wrapper input { padding: 12px 16px; font-size: 0.9rem; }
    .btn { padding: 14px; font-size: 0.9rem; letter-spacing: 2px; }

    footer { padding: 25px 0; font-size: 0.7rem; }

    .dash-card { padding: 20px 15px; }
    .dash-icon { font-size: 2rem; }

    .user-avatar { width: 50px; height: 50px; font-size: 1.2rem; }
    .user-name { font-size: 1.1rem; }
    .user-email { font-size: 0.75rem; }

    .project-link { font-size: 0.8rem; }
    .project-icon { font-size: 1rem; }
}

.btn-google {
    display:inline-flex;align-items:center;justify-content:center;
    padding:12px 24px;border-radius:12px;
    background:#fff;color:#444;
    font-size:0.95rem;font-weight:600;
    text-decoration:none;
    transition:all 0.3s;
    box-shadow:0 2px 8px rgba(0,0,0,0.15);
}
.btn-google:hover {
    transform:translateY(-2px);
    box-shadow:0 6px 20px rgba(0,0,0,0.25);
}


/* === Correcoes de consistencia register vs login === */

/* Select igual ao input */
.input-wrapper select {
    width: 100%;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}
.input-wrapper select:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.2);
}
.input-wrapper select option {
    background: #1a1a2e;
    color: #e0e0ff;
}

/* Section titles */
.section-title {
    color: #aaaacc;
    margin-top: 25px;
    margin-bottom: 15px;
    letter-spacing: 2px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* Button disabled */
.btn:disabled,
.btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn:disabled:hover,
.btn[disabled]:hover {
    transform: none;
    box-shadow: none;
}

/* LGPD badge */
.lgpd-badge {
    display: inline-block;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.75rem;
    color: #7c3aed;
}

/* Consent box */
.consent-box {
    margin-top: 25px;
    padding: 15px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 12px;
}
.consent-box label {
    font-size: 0.85rem;
    color: #c0c0dd;
    cursor: pointer;
}

/* Password meter */
.password-meter {
    margin-top: 8px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}
.password-meter-bar {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s, background 0.3s;
}
.password-requirements {
    font-size: 0.75rem;
    color: #8888aa;
    margin-top: 5px;
    line-height: 1.6;
}
.req-met { color: #4ade80 !important; }
.req-unmet { color: #8888aa !important; }

/* Loading CEP */
.loading-cep {
    font-size: 0.8rem;
    color: #7c3aed;
    margin-top: 5px;
    display: none;
}

/* Main card consistent width */
.main-card {
    max-width: 500px;
}

/* Links inside card */
.main-card a:not(.btn):not(.btn-google) {
    color: #7c3aed;
    text-decoration: none;
    transition: opacity 0.3s;
}
.main-card a:not(.btn):not(.btn-google):hover {
    opacity: 0.8;
}

/* Error msg margin bottom */
.error-msg.show {
    margin-bottom: 20px;
}

/* Mobile responsive for register */
@media (max-width: 480px) {
    .main-card {
        padding: 20px;
        max-width: 100%;
    }
    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    .address-row,
    .address-row-3 {
        flex-direction: column;
        gap: 0;
    }
    .address-row .form-group,
    .address-row-3 .form-group {
        width: 100%;
    }
}
