/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */
.pg-family-members .pg-family-member-form {
    display: none;
    margin: 15px 0;
}

.pg-family-members-header {
    display: flex;
    gap: 8px;
    margin: 10px 0 20px;
}

.pg-family-members-header button:hover{
    text-decoration: none;
}

.pg-family-member-list {
    margin-top: 30px;
}

.pg-family-member-add {
    background: transparent;
    border: none;
    outline: none;
    color: #b21111;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    padding: 0;
    cursor: pointer;
}

.pg-family-member-add-icon {
    display: inline-block;
    margin-right: 6px;
    font-weight: 700;
}

.pg-family-member-add-secondary {
    font-size: 14px;
    color: #b21111;
}

.pg-family-member-add-secondary:hover{
    color: #b21111;
}

.pg-family-members .pg-family-member-form.is-open {
    display: block;
}

.pg-family-member-card {
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    background: #fff;
    padding: 18px;
    margin: 18px 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.pg-family-member-card-header {
    display: flex;
    align-items: center;
    gap: 18px;
}

.pg-family-member-avatar img {
    border-radius: 50%;
    width: 96px;
    height: 96px;
    object-fit: cover;
    display: block;
}

.pg-family-member-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #d1d5db;
    color: #111827;
    flex: 0 0 auto;
}

/* Some themes hide the last profile tab item; ensure the Family Members tab stays visible. */
#pg-profile-tabs ul.pm-profile-tab-wrap > li.pm-profile-tab.pg-family-member-tab,
#pg-profile-tabs ul.pm-profile-tab-wrap > li.pm-profile-tab.pg-family-member-tab:last-child {
    display: list-item !important;
}

.pg-family-member-summary {
    flex: 1;
}

.pg-family-member-name {
    font-size: 28px;
    font-weight: 700;
    color: #b21111;
    margin-bottom: 6px;
}

.pg-family-member-toggle {
    background: none;
    border: none;
    padding: 0;
    color: #b21111;
    font-size: 13px;
    cursor: pointer;
    text-transform: none;
}

.pg-family-member-toggle:hover,
.pg-family-member-toggle:focus {
    color: #b21111;
    opacity: 1;
    text-decoration: none;
}

.pg-family-toggle-close {
    display: none;
}

.pg-family-member-card.is-open .pg-family-toggle-open {
    display: none;
}

.pg-family-member-card.is-open .pg-family-toggle-close {
    display: inline;
}

.pg-family-member-remove-link {
    background: none;
    border: none;
    color: #b21111;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pg-family-member-visibility {
    display: inline-flex;
    align-items: center;
    margin-right: 12px;
}

.pg-family-member-visibility-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #b21111;
    cursor: pointer;
}

.pg-family-member-visibility-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pg-family-member-visibility-slider {
    position: relative;
    width: 34px;
    height: 18px;
    background: #d1d5db;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.pg-family-member-visibility-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.pg-family-member-visibility-input:checked + .pg-family-member-visibility-slider {
    background: #16a34a;
}

.pg-family-member-visibility-input:checked + .pg-family-member-visibility-slider::before {
    transform: translateX(16px);
}

.pg-family-member-visibility-input:focus + .pg-family-member-visibility-slider {
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
}

.pg-family-member-remove-link:hover,
.pg-family-member-remove-link:focus {
    color: #b21111;
    opacity: 1;
    text-decoration: none;
}

.pg-family-member-details {
    display: none;
    margin-top: 16px;
    border-top: 1px solid #ededed;
    padding-top: 16px;
}

.pg-family-member-card.is-open .pg-family-member-details {
    display: block;
}

.pg-family-member-edit {
    background: none;
    border: none;
    color: #b21111;
    font-size: 13px;
    cursor: pointer;
    margin: 8px 0 12px;
    padding: 0;
}

.pg-family-member-edit:hover,
.pg-family-member-edit:focus {
    color: #b21111;
    opacity: 1;
    text-decoration: none;
}

.pg-family-member-edit-form {
    display: none;
    margin: 10px 0 20px;
}

.pg-family-member-edit-form.is-open {
    display: block;
}

.pg-family-member-field-row {
    margin: 8px 0;
    display: flex;
    gap: 12px;
}

.pg-family-member-label {
    min-width: 140px;
    font-weight: 600;
}

.pg-family-member-avatar-preview {
    margin-top: 8px;
}

.pg-family-member-avatar-img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
    display: block;
}

.pg-family-file {
    max-width: 260px;
}

/* ---------- Family Member Form (Existing) ---------- */

.pg-family-member-form.pg-family-member-form-existing {
    max-width: 720px;
    margin: 16px 0;
    padding: 18px;
    border-radius: 14px;
    background: #fff;
    font-family: inherit;
}

.pg-family-member-form.pg-family-member-form-existing.is-open {
    animation: pgFadeInUp .25s ease-out;
}

@keyframes pgFadeInUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to   {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Field block */
.pg-family-member-form-existing .pg-family-member-fields {
    margin-bottom: 14px;
    display: inline-block;
}

/* Label */
.pg-family-member-form-existing .pg-family-member-fields > label {
    font-weight: 600;
    font-size: 14px;
    color: rgba(0,0,0,.78);
}


/* Inputs and select */
.pg-family-member-form-existing .pg-family-input {
    width: 100%;
    height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(0,0,0,.14);
    border-radius: 12px;
    background: #fff;
    color: rgba(0,0,0,.88);
    font-size: 14px;
    line-height: 1.2;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .05s ease;
}

.pg-family-member-form-existing .pg-family-input:focus {
    border-color: rgba(0,0,0,.35);
    box-shadow: 0 0 0 4px rgba(0,0,0,.08);
}

.pg-family-member-form-existing .pg-family-input::placeholder {
    color: rgba(0,0,0,.45);
}
.pg-family-member-form-existing label.pg-family-input.pg-family-radio {
    width: auto;
    border: 0px;
    height: auto;
    display: inline-block;
}

/* Make select look consistent */
.pg-family-member-form-existing select.pg-family-input {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(0,0,0,.55) 50%),
        linear-gradient(135deg, rgba(0,0,0,.55) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 18px,
        calc(100% - 12px) 18px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

/* Description text */
.pg-family-member-form-existing .description {
    margin: 0;
    font-size: 13px;
    color: rgba(0,0,0,.55);
}

/* Buttons */
.pg-family-member-form-existing .button {
    padding: 0 14px;
    text-align:left;
    border-radius: 12px;
    background: transparent;
    color: rgba(188,23,30,0.7);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: transform .05s ease, box-shadow .15s ease, background .15s ease;
}

.pg-family-member-form-existing .button:hover {
    background: #efefef;
    box-shadow: 0 10px 20px rgba(0,0,0,.08);
}

.pg-family-member-form-existing .button:active {
    transform: translateY(1px);
}

/* Search button (secondary) */
.pg-family-member-form-existing .pg-family-member-search {
    width: 100px !important;
    display: inherit;
    background-color: transparent !important;
    min-width: 100px !important;
}

.pg-family-member-form-existing .pg-family-member-search:hover,
.pg-family-member-form-existing .pg-family-member-search:focus {
    background-color: #efefef !important;
    color: rgba(188,23,30,0.9);
    opacity: 1;
    text-decoration: none;
}

/* Primary CTA */
.pg-family-member-form-existing .pg-family-member-save {
    width: auto;
    border: none;
    background: #b21111;          /* primary */
    color: #fff;
    box-shadow: 0 10px 22px rgba(0,0,0,.18);
}

.pg-family-member-form-existing .pg-family-member-save:hover {
    background: rgba(188,23,30,0.7);
}

/* Optional: subtle separation for the footer area */
.pg-family-member-form-existing > p:last-child {
    margin: 14px 0 0;
}

/* ---------- Family Member Form (New/Edit) ---------- */
.pg-family-member-form.pg-family-member-form-new,
.pg-family-member-edit-form {
    max-width: 720px;
    margin: 16px 0;
    padding: 18px;
    border-radius: 14px;
    background: #fff;
}

.pg-family-member-form .pm-col,
.pg-family-member-edit-form .pm-col {
    margin-bottom: 14px;
}

.pg-family-member-form .pm-field-lable,
.pg-family-member-edit-form .pm-field-lable {
    margin-bottom: 6px;
}

.pg-family-member-form .pm-field-lable label,
.pg-family-member-edit-form .pm-field-lable label {
    font-weight: 600;
    color: rgba(0, 0, 0, 0.78);
}

.pg-family-member-form .pm-field-input input[type="text"],
.pg-family-member-form .pm-field-input input[type="email"],
.pg-family-member-form .pm-field-input input[type="url"],
.pg-family-member-form .pm-field-input input[type="tel"],
.pg-family-member-form .pm-field-input input[type="number"],
.pg-family-member-form .pm-field-input input[type="password"],
.pg-family-member-form .pm-field-input textarea,
.pg-family-member-form .pm-field-input select,
.pg-family-member-edit-form .pm-field-input input[type="text"],
.pg-family-member-edit-form .pm-field-input input[type="email"],
.pg-family-member-edit-form .pm-field-input input[type="url"],
.pg-family-member-edit-form .pm-field-input input[type="tel"],
.pg-family-member-edit-form .pm-field-input input[type="number"],
.pg-family-member-edit-form .pm-field-input input[type="password"],
.pg-family-member-edit-form .pm-field-input textarea,
.pg-family-member-edit-form .pm-field-input select {
    width: 100%;
    max-width: 100%;
    height: 44px;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 12px;
    background: #fff;
    color: rgba(0, 0, 0, 0.88);
    font-size: 14px;
    line-height: 1.2;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.pg-family-member-form .pm-field-input textarea,
.pg-family-member-edit-form .pm-field-input textarea {
    height: auto;
    min-height: 100px;
}

.pg-family-member-form .pm-field-input input:focus,
.pg-family-member-form .pm-field-input textarea:focus,
.pg-family-member-form .pm-field-input select:focus,
.pg-family-member-edit-form .pm-field-input input:focus,
.pg-family-member-edit-form .pm-field-input textarea:focus,
.pg-family-member-edit-form .pm-field-input select:focus {
    border-color: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08);
}

.pg-family-member-form .pm-field-input .pm-radio-option,
.pg-family-member-edit-form .pm-field-input .pm-radio-option {
    margin: 4px 0;
}

.pg-family-member-form .pm-field-input .pmradio,
.pg-family-member-edit-form .pm-field-input .pmradio {
    display: grid;
    gap: 6px;
}

.pg-family-member-form .button.pg-family-member-save,
.pg-family-member-edit-form .button.pg-family-member-save {
    width: auto;
    border: none;
    background: #b21111;
    color: #fff;
    box-shadow: 0 10px 22px rgba(0,0,0,.18);
    border-radius: 12px;
    padding: 8px 16px;
    font-weight: 600;
    margin-top: 30px;
}

.pg-family-member-form .button.pg-family-member-save:hover,
.pg-family-member-edit-form .button.pg-family-member-save:hover {
    background: rgba(188,23,30,0.7);
}


/* ========== FAMILY MEMBERS WRAPPER ========== */
#pg-family-members {
    max-width: 1000px;
    margin: 0 auto;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ========== EMPTY STATE ========== */
.pg-family-member-empty {
    padding: 24px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* ========== HEADER ACTIONS ========== */
.pg-family-members-header {
    gap: 12px;
    margin: 24px 0;

}

.pg-family-member-add {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px !important;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.pg-family-member-add-primary,
.pg-family-member-add-secondary {
    background: #e5e7eb;
    color: #111827;
}

.pg-family-member-add:hover {
    background: #d1d5db;
    color: #111827;
}

.pg-family-member-add.is-active {
    background: #bc171e;
    color: #fff;
}

.pg-family-member-add.is-active:hover {
    background: #b0151b;
    color: #fff;
}

.pg-family-member-add-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}

/* ========== FORM CARD ========== */
.pg-family-member-form {

    padding: 24px;
    margin-bottom: 28px;
   
}

/* Hide inactive form if JS toggles */
.pg-family-member-form:not(.is-open) {
    display: none;
}

/* ========== FIELD GRID ========== */
.pg-family-member-fields {

}

/* ========== FIELD ========== */
.pg-family-member-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #374151;
}

.pg-family-input.pg-family-text,
.pg-family-input.pg-family-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    background: #fff;
}

.pg-family-input:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* ========== RADIO & CHECKBOX ========== */
.pg-family-radio,
.pg-family-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    margin-bottom: 6px;
}

.pg-family-radio input,
.pg-family-checkbox input {
    accent-color: #2563eb;
}

/* ========== EMAIL ERROR ========== */
.pg-family-email-error {
    font-size: 12px;
    color: #dc2626;
    margin-top: 4px;
}

/* ========== SEARCH ROW ========== */
.pg-family-member-search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.pg-family-member-search-message {
    margin: 6px 0 0;
    font-size: 12px;
    color: #b21111;
    display: none;
}

.pg-family-member-search-row button {
    padding: 10px 14px;
}

.pg-family-member-search-row .pg-family-input.pg-family-text{
    width: 350px;
}

/* ========== FOOTER ACTION ========== */
.pg-family-member-save {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.pg-family-member-save:hover {
    background: #059669;
    border-color: #059669;
}

/* ========== DESCRIPTION TEXT ========== */
.pg-family-member-form .description {
    font-size: 12px;
    color: #6b7280;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
    .pg-family-members-header {
        flex-direction: column;
    }

    .pg-family-member-search-row {
        flex-direction: column;
    }
}


.pg-family-member-field {
    margin-bottom: 20px;
}

.pg-family-member-form-separator {
    margin: 18px 0 10px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
    color: #111827;
    font-size: 14px;
}
