/* =======================================================================
   ZOL — Member profile self-service
   ======================================================================= */

.profile-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--paper);
    padding-bottom: 32px;
}

.profile-section {
    background: #fff;
    border: 1px solid var(--paper-3);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    margin: 14px 16px;
}
.profile-section h3 {
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--forest);
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.profile-section.danger {
    border-color: rgba(181, 74, 61, 0.3);
    background: rgba(181, 74, 61, 0.02);
}
.profile-section.danger h3 {
    color: var(--error);
}

/* Read-only identity display */
.profile-identity {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 14px;
    align-items: center;
}
.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--paper-2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--shop-primary);
}
.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-avatar .placeholder {
    font-family: var(--font-display);
    font-size: 32px;
    color: var(--forest);
    font-weight: 600;
}
.profile-name {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--forest);
    margin: 0 0 2px;
    line-height: 1.1;
}
.profile-meta {
    font-size: 13px;
    color: rgba(14, 31, 20, 0.6);
}
.profile-meta .mono {
    font-family: 'Menlo', 'Monaco', monospace;
}

/* Read-only field rows */
.profile-readonly-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--paper-3);
    font-size: 14px;
}
.profile-readonly-row:last-child {
    border-bottom: none;
}
.profile-readonly-row .label {
    color: rgba(14, 31, 20, 0.6);
}
.profile-readonly-row .value {
    color: var(--ink);
    font-weight: 500;
    text-align: right;
}

/* Section save button + saved indicator */
.profile-section-foot {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}
.profile-saved-tag {
    color: var(--success);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity 200ms ease;
}
.profile-saved-tag.is-visible { opacity: 1; }

.profile-action-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: #fff;
    border: 1px solid var(--paper-3);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    cursor: pointer;
    text-align: left;
    color: var(--ink);
    font-size: 15px;
    transition: border-color 120ms ease;
}
.profile-action-btn:hover {
    border-color: var(--shop-primary);
}
.profile-action-btn.danger {
    color: var(--error);
}
.profile-action-btn.danger:hover {
    border-color: var(--error);
}
.profile-action-btn .label {
    font-weight: 500;
}
.profile-action-btn .arrow {
    color: rgba(14, 31, 20, 0.4);
}
.profile-action-btn .sub {
    font-size: 13px;
    color: rgba(14, 31, 20, 0.55);
    margin-top: 2px;
}
.profile-action-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Selfie modal */
.selfie-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--paper);
    display: flex;
    flex-direction: column;
}
.selfie-modal[hidden] { display: none !important; }

/* When selfie modal is open, prevent the Leaflet map underneath from showing through.
   Leaflet uses high internal z-indexes (200-700) on its panes/controls that can
   poke through fixed-positioned overlays. */
body:has(.selfie-modal:not([hidden])) .leaflet-container,
body:has(.selfie-modal:not([hidden])) .leaflet-pane,
body:has(.selfie-modal:not([hidden])) .leaflet-top,
body:has(.selfie-modal:not([hidden])) .leaflet-bottom {
    z-index: 1 !important;
}
.selfie-modal-head {
    background: var(--shop-primary);
    color: var(--shop-on-primary);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.selfie-modal-head h2 {
    font-family: var(--font-display);
    font-size: 18px;
    margin: 0;
    color: currentColor;
    font-weight: 500;
}
.selfie-modal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}
.selfie-modal-foot {
    padding: 14px 16px;
    border-top: 1px solid var(--paper-3);
    background: #fff;
    display: flex;
    gap: 10px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
}
.selfie-modal-foot .btn { flex: 1; }

.selfie-current {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    margin: 0 auto 16px;
    overflow: hidden;
    border: 3px solid var(--paper-3);
    background: var(--paper-2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.selfie-current img { width: 100%; height: 100%; object-fit: cover; }
.selfie-current .placeholder {
    color: rgba(14, 31, 20, 0.3);
    font-size: 13px;
}

.selfie-consent {
    background: var(--paper-2);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 18px;
}
.selfie-consent .checkbox-label {
    display: flex;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}
.selfie-consent input { margin-top: 3px; flex-shrink: 0; }

/* Delete confirmation modal */
.delete-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(14, 31, 20, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.delete-confirm-modal[hidden] { display: none !important; }
.delete-confirm-card {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 24px 24px 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.delete-confirm-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: rgba(181, 74, 61, 0.12);
    color: var(--error);
    display: flex;
    align-items: center;
    justify-content: center;
}
.delete-confirm-card h3 {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--forest);
    margin: 0 0 10px;
    text-align: center;
}
.delete-confirm-card .body {
    color: rgba(14, 31, 20, 0.7);
    line-height: 1.5;
    font-size: 14px;
    margin: 0 0 18px;
    text-align: center;
}
.delete-confirm-card .body strong {
    color: var(--error);
}
.delete-confirm-actions {
    display: flex;
    gap: 10px;
}
.delete-confirm-actions .btn {
    flex: 1;
}
.btn-danger {
    background: var(--error);
    color: #fff;
    border-color: var(--error);
}
.btn-danger:hover {
    background: #9c3f33;
}
