.cmsw-member-profile {
    max-width: 480px;
    margin: 0 auto;
    padding: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.member-profile__auth #instructions {
    display: flex;
    width: 100%;
    flex-direction: column;
}

.member-profile__auth #instructions aside {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 0.875rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #0c5460;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    line-height: 1.6;
}

.member-profile__auth h2,
.member-profile__card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.member-profile__field {
    margin-bottom: 1rem;
}

.member-profile__field label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.member-profile__field input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.member-profile__field input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.member-profile__button {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background-color: #0073aa;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0.5rem;
}

.member-profile__button:hover {
    background-color: #005a87;
}

.member-profile__button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.member-profile__error {
    background: #fef0f0;
    border: 1px solid #f5c6cb;
    color: #a94442;
    padding: 0.6rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.member-profile__card {
    background: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 1.25rem;
}

.member-profile__section {
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.member-profile__section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

#profile-logout-container {
    display: flex;
    justify-content: center;
    margin: 0 0 1.5rem 0;
}

.member-profile__value-with-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.member-profile__row button.member-profile__eye-toggle {
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid #ddd;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    border-radius: 4px;
    flex-shrink: 0;
}

.member-profile__row button.member-profile__eye-toggle:hover {
  color: var(--cmsw-primary);
  background: var(--cmsw-primary-lighter);
}

.member-profile__row button.member-profile__eye-toggle:focus {
  outline: 2px solid #1a5757;
  outline-offset: 2px;
}

.member-profile__row button.member-profile__eye-toggle svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.member-profile__row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    font-size: 0.9rem;
}

.member-profile__label {
    font-weight: 600;
    color: #555;
}

.member-profile__value {
    color: #222;
    text-align: right;
}

.member-profile__empty {
    color: #888;
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.member-profile__logout {
    margin-top: 1.25rem;
    width: 100%;
    background-color: #666;
}

.member-profile__logout:hover {
    background-color: #444;
}

/* Editable rows */
.member-profile__row--editable {
    align-items: center;
}

.member-profile__input {
    width: 80px;
    padding: 0.25rem 0.5rem;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: right;
    box-sizing: border-box;
}

.member-profile__input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.member-profile__row button.member-profile__edit-btn,
.member-profile__row button.member-profile__save-btn,
.member-profile__row button.member-profile__cancel-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid #ddd;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    border-radius: 4px;
    flex-shrink: 0;
}

.member-profile__row button.member-profile__edit-btn:hover {
    color: var(--cmsw-primary);
    background: var(--cmsw-primary-lighter);
}

.member-profile__row button.member-profile__save-btn:hover {
    color: #28a745;
    background: var(--cmsw-primary-lighter);
}

.member-profile__row button.member-profile__cancel-btn:hover {
    color: #a94442;
    background: var(--cmsw-primary-lighter);
}

.member-profile__row button.member-profile__edit-btn:focus,
.member-profile__row button.member-profile__save-btn:focus,
.member-profile__row button.member-profile__cancel-btn:focus {
    outline: 2px solid #1a5757;
    outline-offset: 2px;
}

.member-profile__row button.member-profile__edit-btn svg,
.member-profile__row button.member-profile__save-btn svg,
.member-profile__row button.member-profile__cancel-btn svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* Toggle button */
.member-profile__row button.member-profile__toggle-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f0f0f0;
    color: #666;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.member-profile__row button.member-profile__toggle-btn--on {
    background: #0073aa;
    color: #fff;
    border-color: #005a87;
}

.member-profile__row button.member-profile__toggle-btn:hover {
    border-color: #999;
}

.member-profile__row button.member-profile__toggle-btn--on:hover {
    background: #005a87;
    border-color: #005a87;
}

/* Toggle row hint */
.member-profile__hint {
    width: 100%;
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.15rem;
    text-align: right;
}

.member-profile__row--toggle {
    flex-wrap: wrap;
}

/* Confirm modal */
.member-profile__modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-profile__modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.member-profile__modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 6px;
    padding: 1.5rem;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.member-profile__modal-dialog h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.member-profile__modal-dialog p {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: #555;
}

.member-profile__modal-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.member-profile__button--secondary {
    background-color: #666;
}

.member-profile__button--secondary:hover {
    background-color: #444;
}

/* Responsive — wider layout on tablet/desktop */
@media (min-width: 768px) {
    .cmsw-member-profile {
        max-width: 640px;
    }
}

@media (min-width: 1024px) {
    .cmsw-member-profile {
        max-width: 800px;
    }
}

/* Utility */
.member-profile--hidden {
    display: none !important;
}
