/**
 * User Profile Page Styles
 */
#user-profile {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
}

#user-profile h2 {
    margin-bottom: 20px;
    color: #333;
}

#user-profile a {
    color: #0073aa;
    text-decoration: none;
}

#user-profile a:hover {
    text-decoration: underline;
}

.cmd-form {
    max-width: 500px;
    margin-bottom: 32px;
}

.cmd-field {
    margin-bottom: 16px;
}

.cmd-field label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 14px;
}

.cmd-field input[type="text"],
.cmd-field input[type="email"],
.cmd-field input[type="tel"],
.cmd-field input[type="password"] {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.cmd-field input[type="email"]:disabled {
    background: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

.cmd-field small {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 12px;
}

.cmd-form input[type="submit"] {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.cmd-form input[type="submit"]:hover {
    background: #005177;
}

.profile-message {
    padding: 12px;
    border-radius: 4px;
    margin: 15px 0;
}

.profile-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.profile-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* =============================================================================
   Family Editor  [cmd_family_editor]
   ============================================================================= */

#cmd-family-editor {
    max-width: 800px;
}

#cmd-family-editor h3 {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin: 32px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

#cmd-family-editor h3:first-of-type {
    margin-top: 16px;
}

/* A visual card to group a section's fields */
.cmd-section {
    background: #f9fafb;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 8px;
}

/* Two-column row for paired fields */
.cmd-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

@media (max-width: 540px) {
    .cmd-field-row {
        grid-template-columns: 1fr;
    }
}

/* Person card – collapsible toggle */
.cmd-person-section {
    margin-bottom: 6px;
}

#cmd-family-editor .cmd-person-toggle {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    text-align: left;
    margin-bottom: 0;
    box-sizing: border-box !important;
    transition: background 0.15s ease, border-color 0.15s ease;
}

#cmd-family-editor .cmd-person-toggle:hover {
    background: #f0f4f8;
    border-color: #cbd5e0;
}

#cmd-family-editor .cmd-person-toggle[aria-expanded="true"] {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
}

#cmd-family-editor .cmd-person-toggle[aria-expanded="true"] + .cmd-person-body {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
}

/* +/- icon */
#cmd-family-editor .cmd-person-toggle-icon {
    flex-shrink: 0 !important;
    width: 22px !important;
    height: 22px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #e2e8f0;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    color: #555;
    transition: background 0.15s ease, color 0.15s ease;
}

#cmd-family-editor .cmd-person-toggle:hover .cmd-person-toggle-icon {
    background: #cbd5e0;
    color: #222;
}

/* Select fields inside cmd-section */
.cmd-section select,
.cmd-section input[type="text"],
.cmd-section input[type="email"],
.cmd-section input[type="tel"],
.cmd-section input[type="date"] {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
}

/* Sticky save bar */
.cmd-sticky-save {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 12px 0;
    margin-top: 24px;
    z-index: 100;
}

.cmd-sticky-save input[type="submit"] {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.cmd-sticky-save input[type="submit"]:hover {
    background: #005177;
}

/* Current family photo preview */
.cmd-current-photo {
    margin-bottom: 10px;
}

.cmd-current-photo img {
    display: block;
    max-width: 200px;
    border-radius: 4px;
    border: 1px solid #ddd;
}
