/* ==========================================
   PERFIL — Dark Celestial Gold Theme
   ========================================== */

.perfil-container {
    padding-top: 100px;
    max-width: 700px;
    padding-bottom: 40px;
}

/* ── TÍTULO ── */
.perfil-titulo {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    color: var(--primary);
    text-align: center;
    margin-bottom: 0.3rem;
    letter-spacing: 1.5px;
    text-shadow: 0 0 30px var(--glow-gold);
    line-height: 1.2;
}
.perfil-titulo i {
    margin-right: 0.5rem;
    filter: drop-shadow(0 0 10px var(--glow-gold));
}

.perfil-subtitulo {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.3px;
}

/* ── DIVIDER ── */
.perfil-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 2rem;
}
.perfil-divider::before,
.perfil-divider::after {
    content: '';
    height: 1px;
    width: 60px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.4;
}
.perfil-divider .divider-ornament {
    color: var(--primary);
    font-size: 0.7rem;
    opacity: 0.7;
    animation: twinkle 3s ease-in-out infinite;
}

/* ── FORM ── */
.perfil-form {
    background: linear-gradient(145deg, rgba(22, 24, 48, 0.8), rgba(30, 33, 60, 0.6));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(197, 165, 90, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}
.perfil-form::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(123, 104, 174, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

/* ── FOTO ── */
.perfil-foto-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.perfil-foto-wrapper {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    box-shadow: 0 0 30px rgba(197, 165, 90, 0.15);
}
.perfil-foto-wrapper:hover {
    border-color: var(--primary);
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(197, 165, 90, 0.3);
}

.perfil-foto {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.perfil-foto-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(197, 165, 90, 0.08);
    color: var(--text-muted);
    gap: 0.3rem;
}
.perfil-foto-placeholder i {
    font-size: 2rem;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--glow-gold));
}
.perfil-foto-placeholder span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ── CAMPOS ── */
.perfil-campo {
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.perfil-campo label {
    display: block;
    color: var(--primary);
    font-family: 'Cinzel', serif;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.perfil-campo label i {
    margin-right: 0.4rem;
    filter: drop-shadow(0 0 6px var(--glow-gold));
}

.perfil-campo input,
.perfil-campo select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    background: rgba(13, 15, 26, 0.7);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-sizing: border-box;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
}
.perfil-campo input::placeholder {
    color: rgba(240, 236, 226, 0.35);
    font-weight: 300;
}
.perfil-campo input:focus,
.perfil-campo select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(197, 165, 90, 0.15), inset 0 2px 5px rgba(0,0,0,0.3);
    background: rgba(22, 24, 48, 0.9);
}
.perfil-campo select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23c5a55a' viewBox='0 0 16 16'%3E%3Cpath d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 14px;
    padding-right: 2.8rem;
    cursor: pointer;
}
.perfil-campo select option {
    background: var(--bg-surface);
    color: var(--text-main);
}

.perfil-dica {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    opacity: 0.7;
}
.perfil-dica strong {
    color: var(--primary-light);
}

/* ── PALETAS ── */
.paletas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.paleta-item {
    height: 55px;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.paleta-item:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.paleta-item.selecionada {
    border-color: var(--primary);
    transform: scale(1.08);
    box-shadow: 0 0 25px var(--glow-gold);
}
.paleta-item.selecionada::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

/* ── FUNDOS COM IMAGEM ── */
.fundos-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.fundo-img-item {
    height: 75px;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.fundo-img-item:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.fundo-img-item.selecionada {
    border-color: var(--primary);
    transform: scale(1.08);
    box-shadow: 0 0 25px var(--glow-gold);
}
.fundo-img-item.selecionada::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

/* ── BOTÕES ── */
.perfil-botoes {
    margin-top: 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

.btn-salvar {
    width: 100%;
    padding: 1rem;
    font-size: 1.05rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.msg-status {
    text-align: center;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    margin-top: 1rem;
    font-size: 0.9rem;
    backdrop-filter: blur(8px);
    position: relative;
    z-index: 1;
}
.msg-status.sucesso {
    background: rgba(67, 233, 123, 0.1);
    color: #43e97b;
    border: 1px solid rgba(67, 233, 123, 0.2);
    box-shadow: 0 4px 15px rgba(67, 233, 123, 0.1);
}
.msg-status.erro {
    background: rgba(255, 87, 108, 0.1);
    color: #ff576c;
    border: 1px solid rgba(255, 87, 108, 0.2);
    box-shadow: 0 4px 15px rgba(255, 87, 108, 0.1);
}

/* ── PREVIEW ── */
.perfil-preview {
    margin-top: 2rem;
    text-align: center;
}
.perfil-preview h3 {
    font-family: 'Cinzel', serif;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.perfil-preview h3 i {
    margin-right: 0.4rem;
    filter: drop-shadow(0 0 6px var(--glow-gold));
}
.perfil-preview canvas {
    width: 100%;
    max-width: 320px;
    border-radius: 18px;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(197, 165, 90, 0.05);
    border: 1px solid var(--glass-border);
}

/* ── MOBILE ── */
@media (max-width: 480px) {
    .perfil-container {
        padding-top: 80px;
    }
    .perfil-titulo {
        font-size: 1.6rem;
    }
    .perfil-form {
        padding: 1.5rem 1.2rem;
    }
    .perfil-foto-wrapper {
        width: 110px;
        height: 110px;
    }
}
