/* =========================================================
   EDITAR PERFIL — editar.php
   ========================================================= */

.editar-page {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 110px 24px 60px;
    min-height: 70vh;
}

/* ---------- Cabeçalho ---------- */
.editar-header {
    margin-bottom: 32px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.editar-title {
    color: #fff;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 2.2em;
    font-weight: 900;
    letter-spacing: -0.8px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.editar-title-bar {
    display: inline-block;
    width: 6px;
    height: 34px;
    border-radius: 3px;
    background: linear-gradient(180deg, #e50914, #ff3d47);
    box-shadow: 0 0 14px rgba(229, 9, 20, 0.6);
}

.editar-subtitle {
    color: #9a9caa;
    font-family: Arial, sans-serif;
    font-size: 0.95em;
    margin: 6px 0 0;
    padding-left: 20px;
}

/* ---------- Grid (preview + form) ---------- */
.editar-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 32px;
    align-items: flex-start;
}

/* ---------- Preview (coluna esquerda) ---------- */
.editar-preview {
    background: linear-gradient(180deg, #1a1c2b 0%, #14161f 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.preview-avatar-wrap {
    position: relative;
    margin-bottom: 8px;
}

.preview-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(229, 9, 20, 0.6);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(229, 9, 20, 0.15);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    display: block;
}

.preview-avatar-wrap:hover .preview-avatar {
    transform: scale(1.04);
    box-shadow:
        0 14px 36px rgba(0, 0, 0, 0.75),
        0 0 80px rgba(229, 9, 20, 0.3);
}

.preview-badge {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 12px;
    background: #e50914;
    color: #fff;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 0.65em;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 100px;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.5);
    white-space: nowrap;
}

.preview-nome {
    color: #fff;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 1.25em;
    font-weight: 800;
    margin: 4px 0 0;
    line-height: 1.2;
    word-break: break-word;
}

.preview-email {
    color: #9a9caa;
    font-family: Arial, sans-serif;
    font-size: 0.88em;
    margin: 0;
    word-break: break-all;
}

.preview-desde {
    color: #6b6d7a;
    font-family: Arial, sans-serif;
    font-size: 0.78em;
    margin: 8px 0 0;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    width: 100%;
}

/* ---------- Formulário (coluna direita) ---------- */
.editar-form {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.form-section {
    background: rgba(14, 11, 20, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 24px;
}

.form-section-title {
    color: #fff;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 1.1em;
    font-weight: 800;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.form-field:last-child {
    margin-bottom: 0;
}

.form-field label {
    color: #c9cad4;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 0.85em;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.form-field input {
    background: rgba(20, 20, 28, 0.85);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 14px 16px;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 0.95em;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    width: 100%;
    box-sizing: border-box;
}

.form-field input::placeholder {
    color: #6b6d7a;
}

.form-field input:focus {
    outline: none;
    border-color: #e50914;
    background: rgba(30, 32, 48, 0.95);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.15);
}

/* ---------- Grid de avatares ---------- */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.avatar-opcao {
    position: relative;
    display: block;
    cursor: pointer;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    aspect-ratio: 1;
    background: #0e0b14;
    border: 2px solid transparent;
}

.avatar-opcao input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.avatar-opcao img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.avatar-opcao:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
}

.avatar-opcao:hover img {
    transform: scale(1.06);
}

/* Avatar selecionado */
.avatar-opcao.is-selected {
    border-color: #e50914;
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.25),
                0 12px 26px rgba(229, 9, 20, 0.3);
}

.avatar-opcao.is-selected img {
    transform: scale(1.02);
}

.avatar-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e50914;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(.2,.9,.3,1.2);
    pointer-events: none;
}

.avatar-opcao.is-selected .avatar-check {
    opacity: 1;
    transform: scale(1);
}

/* ---------- Ações (botões) ---------- */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
    padding-top: 8px;
}

.btn-cancelar,
.btn-salvar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 12px;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 0.95em;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease,
                background 0.25s ease, border-color 0.25s ease;
    border: none;
    min-width: 140px;
}

.btn-cancelar {
    background: transparent;
    color: #c9cad4;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.btn-cancelar:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-salvar {
    background: linear-gradient(135deg, #e50914, #ff3d47);
    color: #fff;
    box-shadow: 0 10px 24px rgba(229, 9, 20, 0.4);
}

.btn-salvar:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(229, 9, 20, 0.6);
}

.btn-salvar:active {
    transform: translateY(0) scale(0.98);
}

/* ---------- Toast ---------- */
.editar-toast {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 14px;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 0.92em;
    font-weight: 600;
    max-width: 380px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    animation: slideInToast 0.35s cubic-bezier(.2,.9,.3,1.2);
}

@keyframes slideInToast {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

.editar-toast.success {
    background: linear-gradient(135deg, #22c55e, #4ade80);
    color: #062015;
}

.editar-toast.error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
}

.editar-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15);
    font-size: 1em;
    font-weight: 800;
    flex-shrink: 0;
}

.editar-toast-text {
    flex: 1;
    line-height: 1.3;
}

.editar-toast-close {
    background: rgba(0, 0, 0, 0.15);
    border: none;
    color: inherit;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.editar-toast-close:hover {
    background: rgba(0, 0, 0, 0.35);
    transform: rotate(90deg);
}

/* =========================================================
   RESPONSIVIDADE
   ========================================================= */
@media (max-width: 1099px) {
    .editar-page { padding: 100px 24px 50px; }
    .editar-grid { grid-template-columns: 260px 1fr; gap: 24px; }
    .preview-avatar { width: 120px; height: 120px; }
    .avatar-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
    .editar-page     { padding: 90px 16px 40px; }
    .editar-title    { font-size: 1.8em; gap: 10px; }
    .editar-title-bar { height: 28px; }
    .editar-subtitle { font-size: 0.88em; padding-left: 16px; }

    .editar-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .editar-preview {
        position: static;
        padding: 24px 18px;
    }

    .preview-avatar { width: 110px; height: 110px; }

    .form-section { padding: 20px 16px; }

    .avatar-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn-cancelar,
    .btn-salvar {
        width: 100%;
        min-width: 0;
    }

    .editar-toast {
        top: auto;
        bottom: 20px;
        left: 16px;
        right: 16px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .editar-page    { padding: 80px 12px 32px; }
    .editar-title   { font-size: 1.5em; }
    .avatar-grid    { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .preview-avatar { width: 96px; height: 96px; }
    .preview-nome   { font-size: 1.1em; }
    .form-section   { padding: 16px 14px; }
    .form-section-title { font-size: 1em; }
    .form-field input   { padding: 12px 14px; font-size: 0.9em; }
}