/* ==========================================
   MYLIFEFACTORY - USER ACCOUNT
   Joomla 5.4 / Helix Ultimate
   ========================================== */

.mlf-account {
    --mlf-black: #101010;
    --mlf-border: #e8e8e8;
    --mlf-muted: #777;
    --mlf-surface: #fafafa;

    width: 100%;
    color: var(--mlf-black);
    padding: 20px 0 50px;
}

/* Page title */

.mlf-account__page-heading h1 {
    font-size: 30px;
    font-weight: 500;
    margin: 0 0 30px;
}

/* Navigation */

.mlf-account__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--mlf-border);
}

.mlf-account__tabs {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    min-width: 0;
}

.mlf-account__tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 19px;
    border: 1px solid var(--mlf-border);
    border-radius: 100px;
    background: #fff;
    color: var(--mlf-black);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease;
}

.mlf-account__tab.is-active {
    background: var(--mlf-black);
    border-color: var(--mlf-black);
    color: #fff;
}

a.mlf-account__tab:hover {
    background: #f3f3f3;
    color: var(--mlf-black);
}

.mlf-account__edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--mlf-border);
    background: #fff;
    color: var(--mlf-black);
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
}

.mlf-account__edit:hover {
    background: var(--mlf-black);
    color: #fff;
}

/* Hero */

.mlf-account__hero {
    padding: 12px 0 34px;
}

.mlf-account__eyebrow {
    display: block;
    color: var(--mlf-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.mlf-account__name {
    font-size: clamp(30px, 4vw, 46px);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -1.5px;
    margin: 0 0 13px;
}

.mlf-account__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--mlf-muted);
}

.mlf-account__meta-divider {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #aaa;
}

/* Sections */

.mlf-account__content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mlf-account__section {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.mlf-account__section-heading {
    margin-bottom: 15px;
}

.mlf-account__section-heading h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.3px;
}

/* Information cards */

.mlf-account__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
}

.mlf-account__field {
    min-width: 0;
    padding: 18px 20px;
    border: 1px solid var(--mlf-border);
    border-radius: 12px;
    background: var(--mlf-surface);
    transition: border-color .2s ease;
}

.mlf-account__field:hover {
    border-color: #ccc;
}

.mlf-account__field-label {
    display: block;
    margin: 0 0 8px;
    color: var(--mlf-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}

.mlf-account__field-value {
    display: block;
    margin: 0;
    color: var(--mlf-black);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.mlf-account__field-value p {
    margin: 0;
}

/* Keyboard accessibility */

.mlf-account__nav a:focus-visible {
    outline: 2px solid var(--mlf-black);
    outline-offset: 3px;
}

/* Tablet */

@media (max-width: 768px) {
    .mlf-account {
        padding: 10px 0 35px;
    }

    .mlf-account__hero {
        padding: 8px 0 28px;
    }

    .mlf-account__content {
        gap: 26px;
    }
}

/* Mobile */

@media (max-width: 540px) {
    .mlf-account__nav {
        gap: 8px;
        margin-bottom: 25px;
        padding-bottom: 15px;
    }

    .mlf-account__tabs {
        gap: 6px;
    }

    .mlf-account__tab {
        padding: 9px 13px;
        font-size: 12px;
        min-height: 38px;
    }

    .mlf-account__edit {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .mlf-account__name {
        font-size: 32px;
        letter-spacing: -1px;
    }

    .mlf-account__meta {
        font-size: 12px;
        gap: 8px;
    }

    .mlf-account__grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .mlf-account__field {
        padding: 15px 17px;
    }

    .mlf-account__section-heading h3 {
        font-size: 16px;
    }
}

/* Very narrow screens */

@media (max-width: 340px) {
    .mlf-account__tab {
        padding: 8px 10px;
        font-size: 11px;
    }
}

/* ==========================================
   MYLIFEFACTORY - EDIT PROFILE
   Joomla 5.4 / Eleva / Helix Ultimate
   ========================================== */

/* Main layout */

.mlf-account--edit {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.mlf-account--edit,
.mlf-account--edit * {
    box-sizing: border-box;
}

/* Active edit icon */

.mlf-account--edit .mlf-account__edit.is-active {
    background: #101010;
    border-color: #101010;
    color: #fff;
    cursor: default;
}

/* Heading */

.mlf-account--edit .mlf-account__hero {
    padding-bottom: 30px;
}

.mlf-account__description {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.7;
    color: #777;
}

/* Form */

.mlf-account__form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

/* Sections */

.mlf-account__edit-section {
    padding: 0;
    margin: 0;
    border: 0;
    min-width: 0;
}

.mlf-account__edit-section
.mlf-account__section-heading {
    margin-bottom: 17px;
}

.mlf-account__section-description {
    margin: -5px 0 18px;
    color: #777;
    font-size: 13px;
    line-height: 1.6;
}

/* Two-column form grid */

.mlf-account__form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 22px;
    width: 100%;
}

/* Field container */

.mlf-account__form-field {
    min-width: 0;
    width: 100%;
}

.mlf-account__form-field .control-group,
.mlf-account__form-field .control-label,
.mlf-account__form-field .controls {
    width: 100%;
    max-width: 100%;
    margin: 0;
    float: none;
    display: block;
}

/* Labels */

.mlf-account__form-field label,
.mlf-account__form-field .control-label {
    display: block;
    margin-bottom: 9px;
    color: #222;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
}

.mlf-account__form-field .form-text,
.mlf-account__form-field .small,
.mlf-account__form-field small {
    display: block;
    color: #888;
    font-size: 12px;
    line-height: 1.5;
    margin-top: 6px;
}

/* Inputs */

.mlf-account--edit input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.mlf-account--edit select,
.mlf-account--edit textarea {
    width: 100%;
    max-width: 100%;
    min-height: 46px;
    padding: 11px 15px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    color: #101010;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: none;
    transition: border-color .2s ease,
                background .2s ease;
}

.mlf-account--edit input:focus,
.mlf-account--edit select:focus,
.mlf-account--edit textarea:focus {
    background: #fff;
    border-color: #101010;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,0,0,.06);
}

/* Disabled / readonly */

.mlf-account--edit input:disabled,
.mlf-account--edit input[readonly] {
    color: #888;
    background: #f5f5f5;
    cursor: not-allowed;
}

/* Joomla password and input groups */

.mlf-account--edit .input-group {
    display: flex;
    width: 100%;
    flex-wrap: nowrap;
}

.mlf-account--edit .input-group > .form-control {
    width: 1%;
    min-width: 0;
    flex: 1 1 auto;
}

.mlf-account--edit .input-group .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 46px;
    border: 1px solid #e5e5e5;
    border-radius: 0 10px 10px 0;
    background: #f5f5f5;
    color: #101010;
}

.mlf-account--edit .input-group > input:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Password strength indicator */

.mlf-account--edit .progress {
    width: 100%;
    max-width: 100%;
    margin-top: 8px;
    border-radius: 20px;
    overflow: hidden;
}

/* Joomla enhanced selects */

.mlf-account--edit .choices,
.mlf-account--edit .choices__inner,
.mlf-account--edit .select2-container {
    width: 100% !important;
    max-width: 100%;
}

.mlf-account--edit .choices__inner {
    min-height: 46px;
    padding: 7px 12px;
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
}

/* MFA */

.mlf-account__mfa {
    width: 100%;
    min-width: 0;
}

/* Form actions */

.mlf-account__form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 22px;
    border-top: 1px solid #e8e8e8;
}

.mlf-account__cancel,
.mlf-account__save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 11px 25px;
    border-radius: 100px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background .2s ease,
                border-color .2s ease,
                color .2s ease;
}

.mlf-account__cancel {
    background: #fff;
    color: #101010;
    border: 1px solid #dedede;
}

.mlf-account__cancel:hover {
    background: #f4f4f4;
    border-color: #ccc;
}

.mlf-account__save {
    background: #101010;
    color: #fff;
    border: 1px solid #101010;
}

.mlf-account__save:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

.mlf-account__save svg {
    flex-shrink: 0;
}

/* Accessibility */

.mlf-account--edit button:focus-visible,
.mlf-account--edit a:focus-visible {
    outline: 2px solid #101010;
    outline-offset: 3px;
}

/* Tablet */

@media (max-width: 768px) {
    .mlf-account__form-grid {
        column-gap: 13px;
        row-gap: 17px;
    }

    .mlf-account__form {
        gap: 26px;
    }
}

/* Mobile */

@media (max-width: 600px) {
    .mlf-account__form-grid {
        grid-template-columns: 1fr;
        gap: 17px;
    }

    .mlf-account--edit .mlf-account__hero {
        padding-bottom: 25px;
    }

    .mlf-account__form-actions {
        gap: 9px;
    }

    .mlf-account__cancel,
    .mlf-account__save {
        padding: 11px 19px;
    }
}

/* Narrow mobile */

@media (max-width: 360px) {
    .mlf-account__form-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .mlf-account__cancel,
    .mlf-account__save {
        padding: 10px;
        white-space: nowrap;
    }
}

/* ==========================================
   MYLIFEFACTORY - EDIT PROFILE REFINEMENTS
   ========================================== */

/* Keep form fields aligned */

.mlf-account--edit .mlf-account__form-grid {
    align-items: start;
}

.mlf-account--edit .mlf-account__form-field {
    min-width: 0;
}

/* Password visibility buttons */

.mlf-account--edit .input-group > .form-control {
    border-radius: 10px 0 0 10px;
}

.mlf-account--edit .input-group > .btn {
    min-height: 46px;
    padding: 0 15px;
    border: 1px solid #e5e5e5;
    border-left: 0;
    border-radius: 0 10px 10px 0;
    background: #fafafa;
}

.mlf-account--edit .input-group > .btn:hover {
    background: #efefef;
}

/* Enhanced timezone dropdown */

.mlf-account--edit .choices__inner {
    display: flex;
    align-items: center;
    min-height: 46px;
    border-radius: 10px;
}

.mlf-account--edit .choices[data-type*="select-one"]::after {
    border-color: #101010 transparent transparent;
}

/* Uniform label spacing */

.mlf-account--edit .mlf-account__form-field .control-label {
    margin-bottom: 9px;
}

/* Remove unwanted Joomla field wrappers */

.mlf-account--edit .mlf-account__form-field .control-group {
    padding: 0;
    border: 0;
    box-shadow: none;
}

/* ==========================================
   MYLIFEFACTORY - PASSWORD FIELD FIX
   Joomla 5.4 / Eleva / Helix Ultimate
   ========================================== */

/* Password input group layout */

.mlf-account--edit .mlf-account__form-field .input-group {
    display: flex !important;
    position: relative;
    align-items: stretch;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* Password text field */

.mlf-account--edit .mlf-account__form-field
.input-group > input.form-control {
    display: block;
    flex: 1 1 0%;
    width: 1% !important;
    min-width: 0;
    max-width: none;
    min-height: 46px;
    margin: 0;
    border-radius: 10px 0 0 10px;
}

/* Password visibility button */

.mlf-account--edit .mlf-account__form-field
.input-group > .btn,
.mlf-account--edit .mlf-account__form-field
.input-group > button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    max-width: 46px;
    margin: 0;
    padding: 0;
    border: 1px solid #e5e5e5;
    border-left: 0;
    border-radius: 0 10px 10px 0;
    background: #fafafa;
    color: #101010;
    box-shadow: none;
    transform: none;
    inset: auto;
    z-index: 1;
}

/* Icon alignment */

.mlf-account--edit .mlf-account__form-field
.input-group > .btn span,
.mlf-account--edit .mlf-account__form-field
.input-group > button span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
}

/* Hover state */

.mlf-account--edit .mlf-account__form-field
.input-group > .btn:hover,
.mlf-account--edit .mlf-account__form-field
.input-group > button:hover {
    background: #efefef;
    color: #101010;
}

/* Password strength progress */

.mlf-account--edit .mlf-account__form-field .progress {
    display: flex;
    width: 100%;
    max-width: 100%;
    height: 7px;
    margin: 10px 0 0;
    padding: 0;
    overflow: hidden;
    border-radius: 100px;
    box-sizing: border-box;
}

/* Keep password field wrappers inside grid */

.mlf-account--edit .mlf-account__form-field,
.mlf-account--edit .mlf-account__form-field .controls {
    min-width: 0;
    max-width: 100%;
}

/* Small screens */

@media (max-width: 600px) {
    .mlf-account--edit .mlf-account__form-field
    .input-group > .btn,
    .mlf-account--edit .mlf-account__form-field
    .input-group > button {
        flex-basis: 44px;
        width: 44px;
        min-width: 44px;
        max-width: 44px;
    }
}
