/* ========================================
   PROFILE & SETTINGS STYLES
   Consistent with dashboard.css patterns
======================================== */

/* ========================================
   PROFILE CONTAINER & LAYOUT
======================================== */
/* PWA-aligned page field (MASTER §2): the WHOLE page is --brand-subtle #F6F8F7
   with white cards floating on top — matching the GrowthPoints PWA app shell.
   The grey is set on <body> (scoped to these app form pages via :has) — NOT on
   the section — so it renders seamlessly across the entire viewport: behind the
   transparent, position:absolute navbar (.fbs__net-navbar), in the .container
   side gutters (max-width:1600px, centred), and below the content. Painting only
   #profileSection (a centred container child) left the body white everywhere the
   section didn't reach → the two-tone "white sliver" behind the navbar/gutters.
   F1 (historical): dashboard accent tokens are re-based to MASTER brand greens
   globally (--bd-accent-color #4A8A68 / --bd-accent-hover #136242, dashboard.css). */
body:has(#profileSection),
body:has(#settingsSection),
body:has(#privacySection),
body:has(#accountManagementSection) {
    background-color: #F6F8F7;
}

#profileSection,
#settingsSection,
#privacySection,
#accountManagementSection {
    background: transparent; /* the <body> provides the seamless grey field */
    min-height: 100vh;
}

/* White top banner on the brand-subtle app pages. The shared navbar
   (.fbs__net-navbar) is position:absolute + transparent by default (it overlays
   marketing hero sections), so over the grey #F6F8F7 field it read grey. Give it
   an opaque white background + a hairline divider so it sits as a clean app bar
   above the grey page — the PWA look (white bar / grey body / white card).
   Scoped to these pages so marketing/dashboard chrome is untouched. */
body:has(#profileSection) .fbs__net-navbar,
body:has(#settingsSection) .fbs__net-navbar,
body:has(#privacySection) .fbs__net-navbar,
body:has(#accountManagementSection) .fbs__net-navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e8ece9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.profile-container {
    max-width: 780px;
    margin: 0 auto;
    padding: var(--bd-spacing-2xl);
    background-color: var(--bd-white);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* Top clearance under the transparent, position:absolute overlay navbar
   (.fbs__net-navbar). The page markup drops the rem-based `pt-5`; this fixed
   px clearance keeps the card just below the navbar buttons without the
   oversized empty band the old `pt-5` + container-margin stack produced (and
   without ballooning at larger root-font sizes). */
#profileSection.section,
#settingsSection.section {
    padding-top: 85px;
}

@media (max-width: 768px) {
    #profileSection.section,
    #settingsSection.section {
        padding-top: 75px;
    }
}

.profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--bd-spacing-xl);
    border-bottom: 1px solid var(--bd-border-color);
    margin-bottom: var(--bd-spacing-2xl);
}

.profile-title {
    font-size: 1.75rem;
    font-weight: var(--bd-font-bold);
    color: var(--bd-text-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--bd-gap-lg);
}

.profile-title i {
    color: var(--bd-accent-color);
}

/* ========================================
   TAB NAVIGATION
======================================== */
.profile-tabs {
    display: flex;
    gap: var(--bd-gap-sm);
    border-bottom: 2px solid var(--bd-grey-light);
    margin-bottom: var(--bd-spacing-2xl);
    overflow-x: auto;
    scrollbar-width: thin;
}

.profile-tab {
    padding: var(--bd-spacing-lg) var(--bd-spacing-2xl);
    font-size: var(--bd-font-base);
    font-weight: var(--bd-font-semibold);
    color: var(--bd-grey-dark);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: color var(--bd-transition-base) var(--bd-transition-easing), background-color var(--bd-transition-base) var(--bd-transition-easing), border-color var(--bd-transition-base) var(--bd-transition-easing); /* was transition:all (motion.md §4) */
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: var(--bd-gap-md);
}

.profile-tab:hover {
    color: var(--bd-accent-color);
    background-color: var(--bd-hover-bg);
}

.profile-tab.active {
    color: var(--bd-accent-color);
    border-bottom-color: var(--bd-accent-color);
    background-color: var(--bd-highlight-bg);
}

.profile-tab i {
    font-size: 1.1em;
}

/* ========================================
   FLAT FIELD SECTION DIVIDERS (Figma-style)
======================================== */
.profile-fields-section {
    display: flex;
    align-items: center;
    gap: var(--bd-gap-lg);
    padding-top: var(--bd-spacing-2xl);
    margin-top: var(--bd-spacing-2xl);
    margin-bottom: var(--bd-spacing-xl);
    border-top: 1px solid var(--bd-border-color);
}

.profile-fields-section:first-of-type {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}

.profile-fields-label {
    font-size: var(--bd-font-xs);
    font-weight: var(--bd-font-bold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--bd-grey-medium);
    white-space: nowrap;
}

/* Toggle group wrapper — location public row + private note */
.profile-toggle-group {
    margin-top: var(--bd-spacing-lg);
    margin-bottom: var(--bd-spacing-xl);
}

.profile-toggle-group .settings-toggle-row {
    border-bottom: none;
    padding-bottom: 0;
}

/* ========================================
   PROFILE IMAGE SECTION
======================================== */
.profile-image-section {
    text-align: center;
    padding: var(--bd-spacing-2xl) var(--bd-spacing-2xl) var(--bd-spacing-xl);
    background: transparent;
    border-bottom: 1px solid var(--bd-border-color);
    margin-bottom: var(--bd-spacing-2xl);
}

.profile-avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: var(--bd-spacing-xl);
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px dashed #86AF99;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform var(--bd-transition-medium) var(--bd-transition-easing);
}

.profile-avatar:hover {
    transform: scale(1.03);
}

.profile-avatar-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 44px;
    height: 44px;
    background-color: var(--bd-accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--bd-transition-base) var(--bd-transition-easing), transform var(--bd-transition-base) var(--bd-transition-easing); /* was transition:all (motion.md §4) */
    border: 3px solid var(--bd-white);
    box-shadow: var(--bd-shadow-sm);
}

.profile-avatar-overlay:hover {
    background-color: var(--bd-accent-hover);
    transform: scale(1.1);
}

.profile-avatar-overlay i {
    color: var(--bd-white);
    font-size: 1rem;
}

.profile-upload-input {
    display: none;
}

.profile-upload-hint {
    font-size: var(--bd-font-sm);
    color: var(--bd-grey-dark);
    margin-top: var(--bd-spacing-md);
}

/* Upload Progress */
.profile-upload-progress {
    width: 100%;
    max-width: 200px;
    height: 6px;
    background-color: var(--bd-grey-light);
    border-radius: var(--bd-radius-pill);
    overflow: hidden;
    margin: var(--bd-spacing-lg) auto 0;
    display: none;
}

.profile-upload-progress.active {
    display: block;
}

.profile-upload-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--bd-accent-color), var(--bd-success-color));
    transition: width var(--bd-transition-base) var(--bd-transition-easing);
}

/* ========================================
   FORM SECTIONS
======================================== */
.profile-section {
    background-color: var(--bd-white);
    border: 1px solid var(--bd-border-color);
    border-radius: var(--bd-radius-lg);
    padding: var(--bd-spacing-2xl);
    margin-bottom: var(--bd-spacing-2xl);
    transition: box-shadow var(--bd-transition-base) var(--bd-transition-easing);
}

.profile-section:hover {
    box-shadow: var(--bd-shadow-md);
}

.profile-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--bd-spacing-xl);
    padding-bottom: var(--bd-spacing-lg);
    border-bottom: 1px solid var(--bd-grey-light);
}

.profile-section-title {
    font-size: var(--bd-font-lg);
    font-weight: var(--bd-font-semibold);
    color: var(--bd-text-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--bd-gap-md);
}

.profile-section-title i {
    color: var(--bd-accent-color);
    font-size: 1.2em;
}

.profile-section-toggle {
    background: none;
    border: none;
    color: var(--bd-grey-dark);
    cursor: pointer;
    padding: var(--bd-spacing-sm);
    transition: transform var(--bd-transition-base) var(--bd-transition-easing);
}

.profile-section-toggle:hover {
    color: var(--bd-accent-color);
}

.profile-section-toggle.collapsed {
    transform: rotate(-90deg);
}

.profile-section-body {
    transition: opacity var(--bd-transition-medium) var(--bd-transition-easing); /* was transition:all; collapse toggles display:none (motion.md §4) */
}

.profile-section-body.collapsed {
    display: none;
}

/* ========================================
   FORM GRID
======================================== */
.profile-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--bd-spacing-xl);
}

.profile-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bd-spacing-xl);
    margin-bottom: var(--bd-spacing-lg);
}

.profile-form-col {
    flex: 1;
    min-width: 250px;
}

.profile-form-col-full {
    flex: 0 0 100%;
}

/* ========================================
   FORM CONTROLS
======================================== */
.profile-form-group {
    margin-bottom: var(--bd-spacing-xl);
}

.profile-form-label {
    display: block;
    font-size: var(--bd-font-sm);
    font-weight: var(--bd-font-semibold);
    color: var(--bd-text-color);
    margin-bottom: var(--bd-spacing-sm);
}

.profile-form-label.required::after {
    content: " *";
    color: var(--bd-danger-color);
}

.profile-form-input {
    width: 100%;
    padding: var(--bd-spacing-lg) var(--bd-spacing-xl);
    font-size: var(--bd-font-base);
    color: var(--bd-text-color);
    background-color: var(--bd-white);
    border: 2px solid #86AF99;
    border-radius: 10px;
    transition: border-color var(--bd-transition-base) var(--bd-transition-easing), box-shadow var(--bd-transition-base) var(--bd-transition-easing); /* was transition:all (motion.md §4) */
}

.profile-form-input:focus {
    outline: none;
    border-color: #4A8A68;
    box-shadow: 0 0 0 3px rgba(74, 138, 104, 0.25);
}

.profile-form-input:disabled {
    background-color: var(--bd-grey-light);
    cursor: not-allowed;
    opacity: 0.7;
}

.profile-form-input::placeholder {
    color: var(--bd-grey-medium);
}

.profile-form-input.error {
    border-color: var(--bd-danger-color);
    box-shadow: 0 0 0 3px rgba(250, 3, 0, 0.1);
}

.profile-form-input.success {
    border-color: var(--bd-success-color);
}

/* Select styling */
.profile-form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e6e6e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Textarea */
.profile-form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Input group with icon */
.profile-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-input-group .profile-form-input {
    flex: 1;
    padding-left: 42px;
}

.profile-input-icon {
    position: absolute;
    left: var(--bd-spacing-xl);
    top: 50%;
    transform: translateY(-50%);
    color: var(--bd-accent-color);
    pointer-events: none;
}

.profile-password-toggle {
    position: absolute;
    right: var(--bd-spacing-xl);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--bd-grey-medium);
    padding: 0;
    line-height: 1;
    font-size: 0.95rem;
    transition: color var(--bd-transition-base) var(--bd-transition-easing);
}

.profile-password-toggle:hover {
    color: var(--bd-accent-color);
}

.profile-input-group:has(.profile-password-toggle) .profile-form-input {
    padding-right: 42px;
}

/* Form help text */
.profile-form-help {
    font-size: var(--bd-font-xs);
    color: var(--bd-grey-dark);
    margin-top: var(--bd-spacing-xs);
}

/* Form error message */
.profile-form-error {
    font-size: var(--bd-font-xs);
    color: var(--bd-danger-color);
    margin-top: var(--bd-spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--bd-gap-xs);
}

.profile-form-error i {
    font-size: 0.9em;
}

/* Form group with validation error */
.form-group-error {
    position: relative;
}

.form-group-error .profile-form-input,
.form-group-error .profile-form-select {
    border-color: var(--bd-danger-color);
    background-color: rgba(220, 53, 69, 0.02);
}

.form-group-error .profile-form-input:focus,
.form-group-error .profile-form-select:focus {
    border-color: var(--bd-danger-color);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Required field indicator */
.form-error-indicator {
    font-size: var(--bd-font-xs);
    color: var(--bd-danger-color);
    margin-top: var(--bd-spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--bd-gap-xs);
    animation: slideDown 0.2s ease-out;
}

.form-error-indicator i {
    font-size: 0.9em;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   BUTTONS
======================================== */
.profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--bd-gap-md);
    padding: var(--bd-spacing-lg) var(--bd-spacing-2xl);
    font-size: var(--bd-font-base);
    font-weight: var(--bd-font-semibold);
    border: none;
    border-radius: 50px; /* F2: MASTER §6 --radius-btn (was 55px) */
    cursor: pointer;
    transition: background-color var(--bd-transition-base) var(--bd-transition-easing), box-shadow var(--bd-transition-base) var(--bd-transition-easing); /* was transition:all (motion.md §4) */
}

.profile-btn-primary {
    background-color: var(--bd-accent-color);
    color: var(--bd-white);
}

.profile-btn-primary:hover {
    background-color: var(--bd-accent-hover);
    box-shadow: var(--bd-shadow-md);
}

.profile-btn-secondary {
    background-color: var(--bd-grey-light);
    color: var(--bd-text-color);
}

.profile-btn-secondary:hover {
    background-color: var(--bd-grey-hover);
}

.profile-btn-outline {
    background-color: transparent;
    border: 2px solid var(--bd-accent-color);
    color: var(--bd-accent-color);
}

.profile-btn-outline:hover {
    background-color: var(--bd-accent-color);
    color: var(--bd-white);
}

.profile-btn-danger {
    background-color: var(--bd-danger-color);
    color: var(--bd-white);
}

.profile-btn-danger:hover {
    background-color: var(--bd-danger-alt);
}

.profile-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.profile-btn-sm {
    padding: var(--bd-spacing-sm) var(--bd-spacing-lg);
    font-size: var(--bd-font-sm);
}

.profile-btn-lg {
    padding: var(--bd-spacing-xl) var(--bd-spacing-2xl);
    font-size: var(--bd-font-md);
}

/* ========================================
   FORM ACTIONS
======================================== */
.profile-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--bd-gap-lg);
    padding-top: var(--bd-spacing-2xl);
    border-top: 1px solid var(--bd-grey-light);
    margin-top: var(--bd-spacing-2xl);
}

/* ========================================
   SETTINGS SPECIFIC
======================================== */
.settings-card {
    background-color: var(--bd-white);
    border: 1px solid var(--bd-border-color);
    border-radius: var(--bd-radius-lg);
    overflow: hidden;
    margin-bottom: var(--bd-spacing-xl);
}

.settings-card-header {
    padding: var(--bd-spacing-xl) var(--bd-spacing-2xl);
    background-color: var(--bd-grey-light);
    border-bottom: 1px solid var(--bd-border-color);
}

.settings-card-title {
    font-size: var(--bd-font-md);
    font-weight: var(--bd-font-semibold);
    color: var(--bd-text-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--bd-gap-md);
}

.settings-card-body {
    padding: var(--bd-spacing-2xl);
}

/* Toggle Switch */
.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--bd-spacing-lg) 0;
    border-bottom: 1px solid var(--bd-grey-light);
}

.settings-toggle-row:last-child {
    border-bottom: none;
}

.settings-toggle-info {
    flex: 1;
}

.settings-toggle-label {
    font-size: var(--bd-font-base);
    font-weight: var(--bd-font-normal);
    color: var(--bd-text-color);
    margin-bottom: var(--bd-spacing-xs);
}

.settings-toggle-desc {
    font-size: var(--bd-font-sm);
    color: var(--bd-grey-dark);
}

/* Modern Toggle Switch */
.toggle-switch {
    position: relative;
    width: 56px;
    height: 32px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #BEBEBE;
    transition: var(--bd-transition-base);
    border-radius: var(--bd-radius-pill);
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: var(--bd-white);
    transition: var(--bd-transition-base);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--bd-accent-color);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(74, 138, 104, 0.25);
}

/* Radio Group */
.settings-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bd-gap-lg);
}

.settings-radio-option {
    display: flex;
    align-items: center;
    gap: var(--bd-gap-md);
    padding: var(--bd-spacing-lg) var(--bd-spacing-xl);
    border: 1px solid var(--bd-border-color);
    border-radius: var(--bd-radius-md);
    cursor: pointer;
    transition: border-color var(--bd-transition-base) var(--bd-transition-easing), background-color var(--bd-transition-base) var(--bd-transition-easing); /* was transition:all (motion.md §4) */
}

.settings-radio-option:hover {
    border-color: var(--bd-accent-color);
    background-color: var(--bd-hover-bg);
}

.settings-radio-option.selected {
    border-color: var(--bd-accent-color);
    background-color: var(--bd-highlight-bg);
}

.settings-radio-option input {
    display: none;
}

.settings-radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--bd-border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--bd-transition-base) var(--bd-transition-easing); /* was transition:all (motion.md §4) */
}

.settings-radio-option.selected .settings-radio-custom {
    border-color: var(--bd-accent-color);
}

.settings-radio-custom::after {
    content: "";
    width: 10px;
    height: 10px;
    background-color: var(--bd-accent-color);
    border-radius: 50%;
    transform: scale(0);
    transition: transform var(--bd-transition-base) var(--bd-transition-easing);
}

.settings-radio-option.selected .settings-radio-custom::after {
    transform: scale(1);
}

/* ========================================
   PASSWORD SECTION
======================================== */
/* F5: the Settings password-strength meter + requirements list now use the
   canonical .strength-meter / .password-rules-list component from auth.css
   (one implementation, shared with the auth pages). The former
   .password-strength* / .password-requirement* duplicate styles were removed. */

/* ========================================
   LOADING STATES
======================================== */
.profile-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--bd-grey-dark);
}

.profile-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bd-grey-light);
    border-top-color: var(--bd-accent-color);
    border-radius: 50%;
    animation: profile-spin 0.8s linear infinite;
}

@keyframes profile-spin {
    to {
        transform: rotate(360deg);
    }
}

.profile-loading-text {
    margin-top: var(--bd-spacing-xl);
    font-size: var(--bd-font-base);
}

/* ========================================
   NOTIFICATIONS / ALERTS
======================================== */
/* F7: profile/settings alerts now use the single canonical `.alert-custom`
   component (Bootstrap-based, styled in site.css) via showAlert(). The bespoke
   .profile-alert* system was removed. */

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .profile-container {
        margin: 15px;
        padding: var(--bd-spacing-xl);
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: var(--bd-spacing-lg);
    }
    
    .profile-tabs {
        justify-content: flex-start;
    }
    
    .profile-tab {
        padding: var(--bd-spacing-md) var(--bd-spacing-lg);
        font-size: var(--bd-font-sm);
    }
    
    .profile-form-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-form-actions {
        flex-direction: column;
    }
    
    .profile-form-actions .profile-btn {
        width: 100%;
    }
    
    .settings-toggle-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--bd-spacing-lg);
    }
    
    .settings-radio-group {
        flex-direction: column;
    }
    
    .settings-radio-option {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .profile-title {
        font-size: 1.4rem;
    }
    
    .profile-avatar {
        width: 120px;
        height: 120px;
    }
    
    .profile-section {
        padding: var(--bd-spacing-lg);
    }
}

/* ========================================
   ADDRESS AUTOCOMPLETE
======================================== */

.address-suggestions-list {
    position: absolute;
    z-index: 1050;
    background: var(--bd-bg-card, #fff);
    border: 1px solid var(--bd-border-color, #dee2e6);
    border-radius: var(--bd-radius-sm, 6px);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    list-style: none;
    margin: 2px 0 0;
    padding: 0;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
}

.address-suggestion-item {
    padding: .5rem .75rem;
    cursor: pointer;
    font-size: var(--bd-font-sm, .875rem);
    line-height: 1.4;
    border-bottom: 1px solid var(--bd-border-color, #dee2e6);
}

.address-suggestion-item:last-child {
    border-bottom: none;
}

.address-suggestion-item:hover {
    background: var(--bd-bg-hover, #f5f5f5);
}

/* Position parent must be relative */
#geoAddress {
    position: relative;
}

.profile-location-search-wrapper {
    position: relative;
}

.profile-map-container {
    width: 100%;
    height: 300px;
    border-radius: var(--bd-radius-sm, 6px);
    border: 1px solid var(--bd-border-color, #dee2e6);
    overflow: hidden;
    margin-bottom: 1rem;
    background: var(--bd-bg-subtle, #f8f9fa);
}

.profile-map-container .atlas-map-canvas {
    border-radius: var(--bd-radius-sm, 6px);
}

/* A11y: canonical brand focus ring (MASTER section 8). */
/* Bordered controls — brand border + 25% halo. */
.profile-form-input:focus-visible,
.profile-form-select:focus-visible {
    outline: none;
    border-color: #4A8A68;
    box-shadow: 0 0 0 3px rgba(74, 138, 104, 0.25);
}

/* Borderless controls — buttons, tabs, section/password toggles. */
.profile-btn:focus-visible,
.profile-tab:focus-visible,
.profile-section-toggle:focus-visible,
.profile-password-toggle:focus-visible {
    outline: 2px solid #4A8A68;
    outline-offset: 2px;
}

/* Toggle switch — ring on the visible slider when the hidden input is focused. */
.toggle-switch input:focus-visible + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(74, 138, 104, 0.25);
}

/* ========================================
   ACCOUNT MANAGEMENT — mirrors the GrowthPoints PWA
   Source of values: PWA Pages/Dashboard/AccountManagement.razor(.css) +
   Layout/DeleteConfirmDialog/DeactivateConfirmDialog + growthpoints-custom.css.
   Crossed with the FregaForce dashboard: centred column on the #F6F8F7 page bg,
   inside the dashboard shell, inheriting the dashboard font. Literal hex is used
   because the modals render outside the #accountManagementSection token scope.
   Pill radius = MASTER §6 --radius-btn 50px (the PWA's 55px is documented drift).
======================================== */
#accountManagementSection {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 88px 16px 80px; /* clears the absolute site header (~54px) + breathing room above the title */
}

.am-form {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.am-page-title {
    font-size: clamp(22px, 5.5vw, 30px);
    font-weight: 700;
    color: #000;
    text-align: center;
    margin: 0 0 4px;
}

.am-back-link {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4A8A68;
    font-weight: 600;
    font-size: 14px;
    text-decoration: underline;
    margin-bottom: 8px;
}
.am-back-link:hover { color: #136242; }

/* Section card (PWA .am-section) */
.am-section {
    width: 100%;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e8ece9;
}

/* Danger-zone card */
.am-section-danger {
    border-color: #f5c6cb;
    background: #fff8f8;
}

.am-section-title {
    display: flex;
    align-items: center;
    font-size: 17px;
    font-weight: 700;
    color: #000;
    margin: 0 0 6px;
}
.am-section-danger .am-section-title { color: #b00020; }
.am-danger-icon { font-size: 15px; color: #b00020; margin-right: 6px; }

.am-section-desc {
    font-size: 14px;
    font-weight: 400;
    color: #848484;
    line-height: 1.5;
    margin: 0 0 16px;
}

.am-inline-error {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #b00020;
    margin: 0 0 12px;
}

/* Pill buttons */
.am-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
}
.am-btn-primary { background: #4A8A68; }
.am-btn-primary:hover { background: #136242; }
.am-btn-secondary { background: #6b6b6b; }
.am-btn-secondary:hover { background: #555; }
.am-btn-danger { background: #c0392b; }
.am-btn-danger:hover { background: #a93226; }
.am-btn-delete { background: #b00020; }
.am-btn-delete:hover { background: #8b0018; }
.am-cancel-btn { background: #6c757d; }
.am-cancel-btn:hover { background: #5a6268; }
.am-btn:disabled { background: #c2d7cc; cursor: not-allowed; }

/* ── PWA confirm-sheet modals ── */
.am-modal {
    display: none;                 /* JS toggles inline display:flex/none */
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;                 /* above the sticky header; z-index tokenisation tracked separately */
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.am-sheet {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 16px;
    padding: 32px 24px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Red warning triangle (PWA .gp-warning-dialog-icon) */
.am-warning-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.am-warning-icon::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 28px solid transparent;
    border-right: 28px solid transparent;
    border-bottom: 48px solid #dc3545;
    border-radius: 4px;
}
.am-warning-icon-inner {
    position: relative;
    z-index: 1;
    font-size: 20px;
    color: #fff;
    margin-top: 8px;
}

.am-sheet-title { font-size: 22px; font-weight: 700; color: #000; margin: 0 0 12px; }
.am-sheet-text { font-size: 15px; color: #000; line-height: 1.5; margin: 0 0 16px; }

.am-sheet-form { width: 100%; }
.am-sheet-form .profile-form-group { text-align: left; margin-bottom: 16px; }
.am-sheet-form .am-btn { margin-top: 8px; }

@media (max-width: 374px) {
    .am-section { padding: 16px; }
    .am-section-title { font-size: 15px; }
    .am-section-desc { font-size: 13px; }
}

