/* Phase 3 extended profile editor — overlay + form.
 *
 * Uses pe2- namespace so we don't collide with the legacy ProfileEdit IIFE
 * styles (.profile-edit-*) injected via injectStyles() in the same file.
 * Forest/sand palette mirrors the rest of KAGN.
 */
.pe2-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 22, 0.55);
    z-index: 10005;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 16px 16px 16px;
    overflow-y: auto;
}

.pe2-modal {
    background: #fbfaf5;
    border-radius: 18px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 18px 40px rgba(20, 30, 22, 0.25);
    border: 1px solid #e7e3d4;
    animation: pe2-slide-up 0.25s ease;
}

@keyframes pe2-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.pe2-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 12px 24px;
    border-bottom: 1px solid #e7e3d4;
}

.pe2-title {
    margin: 0;
    color: var(--forest-800, #1a3a2a);
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 600;
}

.pe2-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    border-radius: 6px;
}

.pe2-close:hover { background: #f3efe1; }

.pe2-body {
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pe2-error {
    background: #fef3f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.pe2-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pe2-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #355e3b;
}

.pe2-input,
.pe2-textarea {
    border: 1.5px solid #d8d3c2;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.95rem;
    font-family: inherit;
    background: #fff;
    color: #1a1a1a;
    transition: border-color 0.15s ease;
    width: 100%;
    box-sizing: border-box;
}

.pe2-textarea {
    resize: vertical;
    min-height: 80px;
}

.pe2-input:focus,
.pe2-textarea:focus {
    outline: none;
    border-color: var(--forest-500, #3d7a52);
    box-shadow: 0 0 0 3px rgba(61, 122, 82, 0.15);
}

.pe2-readonly {
    padding: 10px 12px;
    background: #f3efe1;
    border-radius: 8px;
    color: #5a4d2c;
    font-size: 0.95rem;
}

.pe2-hint {
    font-size: 0.75rem;
    color: #6b7280;
}

.pe2-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.pe2-toggle {
    width: 18px;
    height: 18px;
    accent-color: var(--forest-500, #3d7a52);
}

.pe2-toggle-label {
    font-size: 0.92rem;
    color: var(--forest-800, #1a3a2a);
    cursor: pointer;
}

.pe2-guide-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: #f3efe1;
    border-radius: 10px;
    border: 1px solid #e7e3d4;
}

.pe2-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 24px 20px 24px;
    border-top: 1px solid #e7e3d4;
}

.pe2-btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.pe2-btn-secondary {
    background: #e7e3d4;
    color: #5a4d2c;
}

.pe2-btn-secondary:hover { background: #d8d3c2; }

.pe2-btn-primary {
    background: var(--forest-500, #3d7a52);
    color: white;
}

.pe2-btn-primary:hover { background: var(--forest-600, #2d5a3d); }
.pe2-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
