:root {
    --perfil-bg: #181825;
    --perfil-panel: #212132;
    --perfil-panel-soft: #29293d;
    --perfil-line: rgba(255, 255, 255, 0.08);
    --perfil-text: #f5f4fb;
    --perfil-muted: #aaabc1;
    --perfil-orange: #FF6709;
    --perfil-orange-deep: #d45708;
    --perfil-success: #48d88a;
    --perfil-shadow: 0 24px 44px rgba(9, 9, 18, 0.34);
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

body {
    margin: 0;
    font-family: var(--meseros-font-family);
    color: var(--perfil-text);
    background:
        radial-gradient(circle at top left, rgba(255, 103, 9, 0.08), transparent 20rem),
        radial-gradient(circle at bottom right, rgba(127, 114, 255, 0.12), transparent 24rem),
        var(--perfil-bg);
    transition: background 0.25s ease, color 0.25s ease;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 10px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
    background: transparent;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.24);
    border: 2px solid transparent;
    background-clip: padding-box;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.perfil-shell {
    min-height: 100vh;
    display: flex;
    gap: 1.4rem;
    padding: 1rem;
}

.back-link svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.perfil-main {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(290px, 350px) minmax(0, 1fr);
    gap: 1.4rem;
}

.perfil-summary,
.perfil-form-panel {
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(35, 35, 52, 0.98), rgba(28, 28, 41, 0.98));
    box-shadow: var(--perfil-shadow);
}

.perfil-summary {
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    width: fit-content;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: #f3f3fa;
}

.profile-card {
    flex: 1;
    border-radius: 28px;
    padding: 1.4rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--perfil-line);
}

.profile-avatar-wrap {
    position: relative;
    width: 148px;
    margin: 0 auto 1.1rem;
}

.profile-avatar {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 4px solid rgba(255, 255, 255, 0.06);
}

.avatar-edit {
    position: absolute;
    right: 0.2rem;
    bottom: 0.4rem;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--perfil-orange), var(--perfil-orange-deep));
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    box-shadow: 0 14px 24px rgba(255, 122, 26, 0.28);
}

.profile-copy {
    text-align: center;
    margin-bottom: 1.35rem;
}

.profile-copy h1 {
    margin: 0 0 0.35rem;
    font-size: 1.8rem;
    font-weight: 800;
}

.profile-copy p {
    margin: 0 0 0.75rem;
    color: var(--perfil-muted);
}

.profile-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    background: rgba(72, 216, 138, 0.12);
    color: #74f0ab;
    font-size: 0.82rem;
    font-weight: 700;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.side-action {
    width: 100%;
    border: 0;
    border-radius: 18px;
    padding: 0.95rem 1rem;
    text-align: left;
    color: #f6f6fc;
    background: rgba(255, 255, 255, 0.04);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.side-action.is-active,
.side-action:hover,
.side-action:focus-visible {
    background: rgba(255, 103, 9, 0.22);
    transform: translateY(-1px);
    outline: none;
}

.perfil-form-panel {
    padding: 1.7rem;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.panel-tag {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #8e90ac;
}

.panel-header h2 {
    font-size: 2rem;
    font-weight: 800;
}

.panel-header p {
    color: var(--perfil-muted);
    max-width: 42rem;
}

.verification-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.8rem 1rem;
    border-radius: 999px;
    background: rgba(72, 216, 138, 0.12);
    color: #a9f0c7;
    font-weight: 700;
    white-space: nowrap;
}

.verification-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--perfil-success);
    box-shadow: 0 0 0 6px rgba(72, 216, 138, 0.15);
}

.field-label {
    display: inline-block;
    margin-bottom: 0.55rem;
    color: #d9daea;
    font-size: 0.92rem;
    font-weight: 600;
}

.gender-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.gender-option {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.8rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #f1f1f9;
}

.gender-option input {
    accent-color: var(--perfil-orange);
}

.dark-input {
    width: 100%;
    min-height: 56px;
    border: 1px solid transparent;
    border-radius: 18px;
    color: #f4f4fb;
    background: var(--perfil-panel-soft);
    box-shadow: none;
}

.dark-input:focus {
    color: #ffffff;
    background: #313149;
    border-color: rgba(255, 122, 26, 0.38);
    box-shadow: 0 0 0 0.2rem rgba(255, 122, 26, 0.14);
}

.form-select.dark-input {
    width: 100%;
    background-image: linear-gradient(45deg, transparent 50%, #d5d6e8 50%), linear-gradient(135deg, #d5d6e8 50%, transparent 50%);
    background-position: calc(100% - 22px) calc(1.35rem), calc(100% - 16px) calc(1.35rem);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.dark-input option {
    color: #f4f4fb;
    background: #29293d;
}

.dark-input option {
    color: #f4f4fb;
    background: #29293d;
}

.input-status-wrap {
    position: relative;
}

.input-status {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9de8bd;
    font-size: 0.88rem;
    font-weight: 700;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    margin-top: 0.75rem;
}

.btn-action-secondary,
.btn-action-primary {
    min-width: 220px;
    min-height: 56px;
    border-radius: 18px;
    font-weight: 700;
    padding: 0.95rem 1.6rem;
}

.btn-action-secondary {
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-action-primary {
    color: #1b1b27;
    background: #FF6709;
    border: 0;
    box-shadow: 0 18px 28px rgba(255, 103, 9, 0.24);
}

body.theme-light {
    --perfil-bg: #f3efe8;
    --perfil-panel: #ffffff;
    --perfil-panel-soft: #f2eee7;
    --perfil-line: rgba(60, 52, 75, 0.08);
    --perfil-text: #2c2734;
    --perfil-muted: #726b79;
    --perfil-shadow: 0 24px 44px rgba(180, 166, 148, 0.22);
    color-scheme: light;
}

body.theme-light {
    background:
        radial-gradient(circle at top left, rgba(255, 103, 9, 0.08), transparent 20rem),
        radial-gradient(circle at bottom right, rgba(255, 194, 121, 0.18), transparent 24rem),
        var(--perfil-bg);
}

body.theme-light .perfil-summary,
body.theme-light .perfil-form-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 245, 240, 0.98));
}

body.theme-light .profile-card {
    background: linear-gradient(180deg, rgba(245, 241, 235, 0.92), rgba(250, 247, 242, 0.92));
}

body.theme-light .back-link {
    color: #635d6b;
}

body.theme-light .dark-input {
    color: #2d2936;
    background: #f0ece6;
}

body.theme-light .dark-input option {
    color: #2d2936;
    background: #ffffff;
}

body.theme-light .dark-input option {
    color: #2d2936;
    background: #ffffff;
}

body.theme-light .dark-input:focus {
    color: #201b28;
    background: #ffffff;
}

body.theme-light .gender-option,
body.theme-light .side-action,
body.theme-light .back-link {
    background: rgba(39, 34, 48, 0.05);
}

body.theme-light .side-action {
    color: #3a3545;
}

body.theme-light .side-action.is-active,
body.theme-light .side-action:hover,
body.theme-light .side-action:focus-visible {
    color: #1f1b27;
    background: rgba(255, 103, 9, 0.22);
}

body.theme-light {
    scrollbar-color: rgba(39, 34, 48, 0.18) transparent;
}

body.theme-light ::-webkit-scrollbar-thumb {
    background: rgba(39, 34, 48, 0.18);
}

body.theme-light ::-webkit-scrollbar-thumb:hover {
    background: rgba(39, 34, 48, 0.28);
}

@media (max-width: 1199.98px) {
    .perfil-main {
        grid-template-columns: 300px minmax(0, 1fr);
    }
}

@media (max-width: 991.98px) {
    .perfil-shell {
        flex-direction: column;
        padding: 0.85rem;
    }

    .perfil-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .perfil-summary,
    .perfil-form-panel {
        border-radius: 26px;
    }

    .profile-card,
    .perfil-form-panel {
        padding: 1.2rem;
    }

    .panel-header {
        flex-direction: column;
    }

    .panel-header h2 {
        font-size: 1.6rem;
    }

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

    .btn-action-secondary,
    .btn-action-primary {
        width: 100%;
        min-width: 0;
    }

    .input-status {
        position: static;
        display: inline-flex;
        margin-top: 0.55rem;
        transform: none;
    }
}

@media (max-width: 575.98px) {
    .gender-group {
        flex-direction: column;
    }
}
