* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --white: #ffffff;
    --background: #f8f9fb;
    --border: #e7e8ec;
    --text: #17181c;
    --text-light: #777b85;
    --text-muted: #a0a3aa;
    --blue: #021B44;
    --blue-hover: #0A285B;
    --success: #16834f;
    --success-bg: #effaf4;
    --danger: #b42318;
    --danger-bg: #fff4f2;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: var(--background);

    color: var(--text);

    min-height: 100vh;
}

button,
input {
    font-family: inherit;
}

button {
    outline: none;
}

a {
    color: inherit;
}


/* =========================================================
   PÁGINA
========================================================= */

.perfil-page {
    min-height: 100vh;

    padding:
        32px
        35px
        45px;
}

.perfil-container {
    width: 100%;
    max-width: 1080px;

    margin: 0 auto;
}


/* =========================================================
   HEADER
========================================================= */

.perfil-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 25px;

    margin-bottom: 25px;
}

.header-left {
    display: flex;

    align-items: center;

    gap: 14px;
}

.header-icon {
    width: 44px;
    height: 44px;

    flex: 0 0 44px;

    display: flex;

    align-items: center;
    justify-content: center;

    background: #f0f2f5;

    color: var(--blue);

    border-radius: 11px;
}

.header-icon svg {
    display: block;
}

.header-label {
    margin-bottom: 4px;

    color: var(--text-muted);

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 1.1px;
}

.perfil-header h1 {
    margin: 0;

    font-size: 22px;
    font-weight: 700;

    letter-spacing: -0.2px;
}

.perfil-header p {
    margin-top: 5px;

    color: var(--text-light);

    font-size: 12px;
}


/* =========================================================
   BOTÓN DASHBOARD
========================================================= */

.btn-volver {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 40px;

    padding: 0 14px;

    border:
        1px solid
        var(--border);

    border-radius: 9px;

    background: var(--white);

    color: #4f535b;

    text-decoration: none;

    font-size: 12px;
    font-weight: 600;

    transition: 0.2s ease;
}

.btn-volver:hover {
    background: #f5f6f8;

    color: var(--blue);

    border-color: #d5d9df;
}

.btn-volver svg {
    display: block;
}


/* =========================================================
   ALERTAS
========================================================= */

.alerta {
    width: 100%;

    min-height: 44px;

    display: flex;

    align-items: center;

    gap: 9px;

    padding: 0 14px;

    margin-bottom: 20px;

    border-radius: 9px;

    border: 1px solid;

    font-size: 12px;
    font-weight: 600;
}

.alerta svg {
    flex: 0 0 auto;
}

.alerta-success {
    color: var(--success);

    background: var(--success-bg);

    border-color: #ccebd9;
}

.alerta-error {
    color: var(--danger);

    background: var(--danger-bg);

    border-color: #f1d0cc;
}


/* =========================================================
   GRID PRINCIPAL
========================================================= */

.perfil-layout {
    display: grid;

    grid-template-columns:
        minmax(300px, 0.9fr)
        minmax(380px, 1.1fr);

    gap: 18px;

    align-items: stretch;
}


/* =========================================================
   TARJETAS
========================================================= */

.card {
    background: var(--white);

    border:
        1px solid
        var(--border);

    border-radius: 13px;

    box-shadow:
        0 2px 8px rgba(16, 24, 40, 0.025);

    overflow: hidden;
}

.card-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    min-height: 72px;

    padding:
        0
        22px;

    border-bottom:
        1px solid
        var(--border);
}

.card-label {
    display: block;

    margin-bottom: 5px;

    color: var(--text-muted);

    font-size: 9px;
    font-weight: 700;

    letter-spacing: 1px;
}

.card-header h2 {
    font-size: 15px;
    font-weight: 700;

    color: var(--text);
}


/* =========================================================
   PERFIL
========================================================= */

.profile-main {
    display: flex;

    flex-direction: column;

    align-items: center;

    text-align: center;

    padding:
        24px
        22px
        20px;
}

.profile-photo-wrapper {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 112px;
    height: 112px;

    margin-bottom: 13px;
}

.profile-photo {
    width: 112px;
    height: 112px;

    display: block;

    border-radius: 50%;

    object-fit: cover;

    border:
        4px solid
        #f1f3f6;

    box-shadow:
        0 0 0 1px
        #e5e8ec;
}

.profile-initial {
    display: flex;

    align-items: center;
    justify-content: center;

    background: var(--blue);

    color: white;

    font-size: 40px;
    font-weight: 700;
}

.profile-user h3 {
    margin: 0;

    font-size: 17px;
    font-weight: 700;
}

.role-badge {
    display: inline-flex;

    align-items: center;

    gap: 6px;

    margin-top: 7px;

    padding:
        5px
        9px;

    border-radius: 20px;

    background: #f3f5f7;

    color: var(--text-light);

    font-size: 10px;
    font-weight: 600;
}

.role-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #16a34a;
}

.profile-divider {
    height: 1px;

    background: var(--border);

    margin: 0 22px;
}


/* =========================================================
   FOTO
========================================================= */

.photo-form {
    display: flex;

    flex-direction: column;

    gap: 9px;

    padding:
        19px
        22px
        0;
}

.file-button {
    width: 100%;

    min-height: 40px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    border:
        1px solid
        var(--border);

    border-radius: 8px;

    background: #fafbfc;

    color: #4d535c;

    cursor: pointer;

    font-size: 12px;
    font-weight: 600;

    transition: 0.2s ease;
}

.file-button:hover {
    background: #f4f6f8;

    border-color: #d3d8df;

    color: var(--blue);
}

.file-button svg {
    display: block;
}

.file-name {
    min-height: 16px;

    padding:
        0
        5px;

    text-align: center;

    color: var(--text-muted);

    font-size: 10px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}

.btn-primary {
    min-height: 40px;

    display: inline-flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    width: 100%;

    border: none;

    border-radius: 8px;

    background: var(--blue);

    color: white;

    cursor: pointer;

    font-size: 12px;
    font-weight: 600;

    transition: 0.2s ease;
}

.btn-primary:hover {
    background: var(--blue-hover);
}

.btn-primary svg {
    display: block;
}

.delete-photo-form {
    padding:
        9px
        22px
        0;
}

.btn-delete {
    width: 100%;

    min-height: 37px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 7px;

    border:
        1px solid
        #efd0cd;

    border-radius: 8px;

    background: var(--danger-bg);

    color: var(--danger);

    cursor: pointer;

    font-size: 11px;
    font-weight: 600;

    transition: 0.2s ease;
}

.btn-delete:hover {
    background: #ffebe8;
}

.photo-help {
    margin: 13px 22px 20px;

    color: var(--text-muted);

    font-size: 10px;

    text-align: center;

    line-height: 1.4;
}


/* =========================================================
   DATOS DE CUENTA
========================================================= */

.account-list {
    padding:
        4px
        22px
        9px;
}

.account-row {
    min-height: 66px;

    display: flex;

    align-items: center;

    gap: 12px;

    border-bottom:
        1px solid
        #f0f1f3;
}

.account-row:last-child {
    border-bottom: none;
}

.account-icon {
    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 8px;

    background: #f3f5f7;

    color: #5f6670;
}

.account-icon svg {
    display: block;
}

.account-row div:last-child {
    min-width: 0;
}

.account-row span {
    display: block;

    margin-bottom: 4px;

    color: var(--text-muted);

    font-size: 10px;
}

.account-row strong {
    display: block;

    color: var(--text);

    font-size: 12px;
    font-weight: 600;

    overflow: hidden;

    text-overflow: ellipsis;

    white-space: nowrap;
}


/* =========================================================
   SEGURIDAD
========================================================= */

.security-card {
    margin-top: 18px;
}

.security-header {
    min-height: 76px;
}

.security-title {
    display: flex;

    align-items: center;

    gap: 11px;
}

.security-icon {
    width: 37px;
    height: 37px;

    flex: 0 0 37px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: #f0f3f7;

    color: var(--blue);
}

.security-icon svg {
    display: block;
}

.password-form {
    padding:
        21px
        22px
        20px;
}

.password-grid {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 15px;
}

.field {
    min-width: 0;
}

.field label {
    display: block;

    margin-bottom: 7px;

    color: #454951;

    font-size: 11px;
    font-weight: 600;
}

.input-wrapper {
    position: relative;

    display: flex;

    align-items: center;
}

.input-wrapper svg {
    position: absolute;

    left: 12px;

    color: var(--text-muted);

    pointer-events: none;
}

.input-wrapper input {
    width: 100%;

    height: 41px;

    padding:
        0
        11px
        0
        37px;

    border:
        1px solid
        var(--border);

    border-radius: 8px;

    outline: none;

    background: white;

    color: var(--text);

    font-size: 11px;

    transition: 0.2s ease;
}

.input-wrapper input::placeholder {
    color: #b0b3b8;
}

.input-wrapper input:focus {
    border-color: #aeb9c9;

    box-shadow:
        0 0 0 3px
        rgba(2, 27, 68, 0.055);
}

.password-footer {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-top: 18px;

    padding-top: 17px;

    border-top:
        1px solid
        var(--border);
}

.password-note {
    color: var(--text-muted);

    font-size: 10px;
}

.btn-password {
    width: auto;

    min-width: 190px;

    padding:
        0
        17px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

    .perfil-page {
        padding: 25px 22px 35px;
    }

    .perfil-layout {
        grid-template-columns: 1fr;
    }

    .password-grid {
        grid-template-columns: 1fr;
    }

    .password-footer {
        align-items: flex-start;

        flex-direction: column;
    }

    .btn-password {
        width: 100%;
    }
}


@media (max-width: 600px) {

    .perfil-page {
        padding:
            20px
            15px
            30px;
    }

    .perfil-header {
        align-items: flex-start;

        flex-direction: column;

        gap: 15px;
    }

    .btn-volver {
        width: 100%;
    }

    .header-left {
        align-items: flex-start;
    }

    .header-icon {
        width: 40px;
        height: 40px;

        flex-basis: 40px;
    }

    .perfil-header h1 {
        font-size: 20px;
    }

    .card-header {
        padding:
            0
            18px;
    }

    .account-list {
        padding:
            4px
            18px
            9px;
    }

    .photo-form {
        padding-left: 18px;
        padding-right: 18px;
    }

    .delete-photo-form {
        padding-left: 18px;
        padding-right: 18px;
    }

    .photo-help {
        margin-left: 18px;
        margin-right: 18px;
    }

    .password-form {
        padding-left: 18px;
        padding-right: 18px;
    }
}


@media (max-width: 400px) {

    .profile-photo,
    .profile-photo-wrapper {
        width: 98px;
        height: 98px;
    }

    .profile-initial {
        font-size: 34px;
    }

    .profile-user h3 {
        font-size: 15px;
    }
}