@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/**
 * Estilos da Página de Edição de Dados Cadastrais (Perfil) — Planner Danik
 * Paleta Pastel Suave, Washi Tape e Tipografia Premium
 */

:root {
    --bg-main: #f9f5f0;
    --paper-bg: #fdfaf7;
    --card-bg: #ffffff;
    --border-soft: #ecd9cf;
    --border-accent: #f2ded6;
    
    --text-dark: #3d312a;
    --text-muted: #7d6e65;
    --text-light: #a8998f;
    
    --accent: #b56576;
    --accent-hover: #9c4d5e;
    --accent-light: #fbebee;
    
    --secondary: #6d597a;
    --secondary-light: #f3eff5;
    
    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;

    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 9999px;
    
    --shadow-card: 0 10px 30px rgba(109, 89, 122, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ========================================================
   Barra Superior de Navegação
   ======================================================== */
.profile-top-nav {
    background: #ffffff;
    border-bottom: 1px solid var(--border-soft);
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.top-nav-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-dark);
    transition: opacity 0.2s ease;
}

.brand-link:hover {
    opacity: 0.85;
}

.brand-logo-badge {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--accent) 0%, #e56b6f 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 19px;
    box-shadow: 0 3px 8px rgba(181, 101, 118, 0.35);
    position: relative;
    overflow: hidden;
}

.brand-logo-badge.has-photo {
    background: transparent !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.brand-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: inherit;
}

.brand-logo-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: 800;
}

.brand-texts {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 16px;
    font-weight: 800;
    color: #2b221e;
    letter-spacing: -0.3px;
}

.brand-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.top-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-nav-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--paper-bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-pill);
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-nav-back:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-nav-logout {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    background: rgba(181, 101, 118, 0.08);
    border: 1px solid rgba(181, 101, 118, 0.2);
    border-radius: var(--radius-pill);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-nav-logout:hover {
    background: var(--accent);
    color: #ffffff;
}

/* ========================================================
   Card Central de Perfil
   ======================================================== */
.profile-main-container {
    flex: 1;
    max-width: 820px;
    width: 100%;
    margin: 32px auto 48px;
    padding: 0 20px;
}

.profile-card {
    background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    padding: 36px 40px;
}

/* Faixa Washi Tape no topo do card */
.profile-washi-tape {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: repeating-linear-gradient(
        45deg,
        #b56576,
        #b56576 15px,
        #e56b6f 15px,
        #e56b6f 30px,
        #eaac8b 30px,
        #eaac8b 45px,
        #6d597a 45px,
        #6d597a 60px
    );
}

/* Cabeçalho do Perfil */
.profile-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 24px;
    border-bottom: 1px dashed var(--border-soft);
    margin-bottom: 28px;
}

.profile-avatar-circle {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fceade 0%, #f7d6c8 100%);
    border: 2px solid #ecd9cf;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: var(--accent);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.profile-title {
    font-size: 24px;
    font-weight: 800;
    color: #2b221e;
    letter-spacing: -0.5px;
}

.profile-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Alertas */
.profile-alerts {
    margin-bottom: 24px;
}

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 12px;
    animation: fadeIn 0.25s ease-out;
}

.alert-success {
    background-color: var(--success-bg);
    border: 1px solid var(--success-border);
    color: #065f46;
}

.alert-danger {
    background-color: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: #991b1b;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   Seções do Formulário
   ======================================================== */
.form-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    margin-top: 10px;
}

.form-section-header .section-icon {
    font-size: 18px;
}

.form-section-header h2 {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-dark);
}

.form-section-header .section-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.security-section-header {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-soft);
}

/* Grupos e Campos de Formulário */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #55443d;
    margin-bottom: 6px;
}

.label-with-badge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.label-with-badge .form-label {
    margin-bottom: 0;
}

.badge-readonly {
    background: #f0e6df;
    border: 1px solid #dfd1c8;
    color: #7d6b5f;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    letter-spacing: 0.2px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    font-family: var(--font-main);
    font-size: 14px;
    color: var(--text-dark);
    background: #ffffff;
    border: 1.5px solid #dfd0c6;
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.2s ease;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(181, 101, 118, 0.15);
    background: #fffdfd;
}

/* Estilo Especial para CPF Não Editável */
.form-input.input-readonly,
.form-input:read-only {
    background-color: #f7efe9;
    border-color: #e4d5cb;
    color: #69564c;
    cursor: not-allowed;
    user-select: none;
    font-weight: 600;
    box-shadow: none !important;
}

.form-input.input-readonly:focus {
    border-color: #e4d5cb;
    box-shadow: none;
}

.field-hint-readonly {
    display: block;
    font-size: 11.5px;
    color: #8c7b70;
    margin-top: 5px;
}

.field-error-msg {
    display: none;
    font-size: 12px;
    color: var(--danger);
    font-weight: 600;
    margin-top: 5px;
}

.form-input.is-invalid {
    border-color: var(--danger);
    background-color: #fff9f9;
}

.form-input.is-invalid ~ .field-error-msg,
.form-group:has(.form-input.is-invalid) .field-error-msg {
    display: block;
}

.form-input.is-valid {
    border-color: var(--success);
}

/* Botão Olhinho (Senha) */
.btn-toggle-pwd {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.6;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.btn-toggle-pwd:hover {
    opacity: 1;
}

/* Card de Alteração de Senha */
.password-change-card {
    background: #fdfaf7;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 18px 20px 8px;
    margin-bottom: 24px;
}

/* Painel de Requisitos da Senha */
.pwd-rules-box {
    background: #ffffff;
    border: 1px solid #f2ded6;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 10px;
    margin-bottom: 14px;
}

.pwd-rules-title {
    font-size: 12px;
    font-weight: 700;
    color: #6c584c;
    margin-bottom: 6px;
}

.pwd-rules-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 10px;
}

.pwd-rule-item {
    font-size: 11.5px;
    color: #8c7d70;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s ease;
}

.pwd-rule-item .rule-icon {
    font-size: 11px;
    font-weight: bold;
    color: #c9b8ab;
}

.pwd-rule-item.valid {
    color: #065f46;
    font-weight: 600;
}

.pwd-rule-item.valid .rule-icon {
    color: var(--success);
}

.pwd-match-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    margin-top: 4px;
    font-weight: 600;
}

.pwd-match-badge.match {
    color: var(--success);
}

.pwd-match-badge.mismatch {
    color: var(--danger);
}

/* ========================================================
   Linha de Ações (Salvar e Cancelar)
   ======================================================== */
.form-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--border-soft);
    margin-top: 12px;
}

.btn-action-cancel {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 22px;
    background: #f7efe9;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    color: #6c584c;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-action-cancel:hover {
    background: #ebdcd3;
    color: #4d3e35;
}

.btn-action-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(181, 101, 118, 0.35);
    transition: all 0.2s ease;
}

.btn-action-save:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(181, 101, 118, 0.4);
}

/* Responsividade & Usabilidade Touch */
@media (max-width: 640px) {
    html, body {
        overflow-x: hidden;
    }
    .profile-card {
        padding: 22px 16px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-actions-row {
        flex-direction: column-reverse;
        gap: 12px;
    }
    .btn-action-save,
    .btn-action-cancel {
        width: 100%;
        justify-content: center;
        min-height: 46px;
    }
    .pwd-rules-list {
        grid-template-columns: 1fr;
    }

    /* Prevenção de Auto-zoom no iOS Safari */
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        font-size: 16px !important;
        min-height: 44px;
    }

    .btn-toggle-pwd {
        min-width: 44px;
        min-height: 44px;
        right: 4px;
        opacity: 0.85;
    }

    .btn-avatar-camera {
        width: 42px;
        height: 42px;
    }
}
