/* ============================================
   SETTINGS PERSONAL PAGE - settings_personal.css
   ============================================ */

/* -----------------------------------------------
   TOP BAR
----------------------------------------------- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px;
    background: white;
    border-bottom: 1px solid var(--border);
    height: 56px;
    flex-shrink: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: opacity 0.2s;
}

.user-avatar:hover {
    opacity: 0.85;
}

/* -----------------------------------------------
   MAIN PANEL
----------------------------------------------- */
.sp-panel {
    flex: 1;
    background: #eef0fb;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sp-panel-header {
    background: white;
    padding: 18px 28px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    flex-shrink: 0;
}

.sp-panel-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: 0.3px;
}

/* -----------------------------------------------
   SCROLLABLE BODY
----------------------------------------------- */
.sp-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 24px 48px;
    gap: 0;
}

/* -----------------------------------------------
   AVATAR
----------------------------------------------- */
.sp-avatar-wrap {
    margin-bottom: 24px;
}

.sp-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: #1e1e2e;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 6px 24px rgba(30, 30, 46, 0.22);
}

/* -----------------------------------------------
   CARD
----------------------------------------------- */
.sp-card {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 20px;
    padding: 30px 32px 28px;
    box-shadow: 0 4px 24px rgba(124, 131, 253, 0.10);
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* -----------------------------------------------
   FIELD GROUP
----------------------------------------------- */
.sp-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sp-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
}

/* -----------------------------------------------
   FIELD ROW (input + icon buttons)
----------------------------------------------- */
.sp-field-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-input-wrap {
    flex: 1;
}

.sp-input {
    width: 100%;
    padding: 11px 16px;
    border: 1.8px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    color: var(--text-dark);
    background: #f8f9ff;
    outline: none;
    transition: border-color 0.2s;
    caret-color: var(--primary);
}

.sp-input:focus {
    border-color: var(--primary);
    background: white;
}

/* Password dots display */
.sp-password-dots {
    font-size: 18px;
    letter-spacing: 3px;
    color: #555;
}

/* -----------------------------------------------
   ICON BUTTONS (eye / edit)
----------------------------------------------- */
.sp-icon-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: #f3f4ff;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.15s;
}

.sp-icon-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.sp-eye-btn {
    color: #888;
}

/* -----------------------------------------------
   INLINE MESSAGES
----------------------------------------------- */
.sp-msg {
    font-size: 12px;
    font-weight: 700;
    padding: 5px 0 0 2px;
}

.sp-msg-error  { color: #e53e3e; }
.sp-msg-success { color: #27ae60; }

.sp-note {
    font-size: 11.5px;
    color: #aaa;
    font-weight: 600;
    padding-left: 2px;
}

/* Field error/success border highlight */
.sp-field-group.has-error .sp-input {
    border-color: #e53e3e;
    background: #fff5f5;
}

.sp-field-group.has-success .sp-input {
    border-color: #27ae60;
    background: #f0fff4;
}

/* -----------------------------------------------
   LOG OUT BUTTON
----------------------------------------------- */
.sp-logout-wrap {
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.sp-logout-btn {
    padding: 12px 52px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.35);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    letter-spacing: 0.3px;
}

.sp-logout-btn:hover {
    background: #e85555;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(255, 107, 107, 0.45);
}

.sp-logout-btn:active {
    transform: translateY(0);
}

/* ============================================
   MODALS
   ============================================ */

.sp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 20, 40, 0.45);
    backdrop-filter: blur(3px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.sp-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.sp-modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    margin: 16px;
    box-shadow: 0 16px 48px rgba(30, 30, 46, 0.22);
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s ease;
    overflow: hidden;
}

.sp-modal-overlay.active .sp-modal {
    transform: translateY(0) scale(1);
}

/* Modal Header */
.sp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border);
    background: #f8f9ff;
}

.sp-modal-header h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-dark);
}

.sp-modal-close {
    width: 32px;
    height: 32px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    transition: background 0.15s, color 0.15s;
}

.sp-modal-close:hover {
    background: #ff6b6b;
    color: white;
}

/* Modal Body */
.sp-modal-body {
    padding: 24px 24px 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sp-modal-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
}

.sp-modal-input {
    width: 100%;
    padding: 11px 16px;
    border: 1.8px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    color: var(--text-dark);
    background: #f8f9ff;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    caret-color: var(--primary);
}

.sp-modal-input:focus {
    border-color: var(--primary);
    background: white;
}

.sp-modal-note {
    font-size: 12px;
    color: #aaa;
    font-weight: 600;
    margin-top: 4px;
}

/* Password wrap inside modal (input + eye btn) */
.sp-modal-pass-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.sp-modal-pass-wrap .sp-modal-input {
    padding-right: 44px;
}

.sp-modal-eye {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    display: flex;
    align-items: center;
    padding: 4px;
    transition: color 0.15s;
}

.sp-modal-eye:hover {
    color: var(--primary);
}

/* Password rules list */
.sp-modal-rules {
    margin-top: 14px;
    background: #f8f9ff;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
}

.sp-modal-rules p {
    font-size: 12px;
    font-weight: 700;
    color: #555;
    margin-bottom: 6px;
}

.sp-modal-rules ul {
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sp-modal-rules ul li {
    font-size: 12px;
    color: #888;
    font-weight: 600;
}

/* Modal Footer */
.sp-modal-footer {
    display: flex;
    gap: 10px;
    padding: 16px 24px 24px;
    justify-content: flex-end;
}

.sp-modal-btn {
    padding: 11px 28px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    border: none;
    cursor: pointer;
    transition: background 0.18s, transform 0.15s, opacity 0.15s;
}

.sp-modal-btn:hover {
    transform: translateY(-1px);
    opacity: 0.92;
}

.sp-modal-btn-cancel {
    background: #f0f0f5;
    color: #666;
}

.sp-modal-btn-cancel:hover {
    background: #e0e0ea;
    opacity: 1;
}

.sp-modal-btn-save {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(124, 131, 253, 0.35);
}

.sp-modal-btn-save:hover {
    background: var(--primary-dark);
    opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 700px) {
    .sp-card {
        padding: 22px 18px 20px;
    }

    .sp-modal {
        max-width: 96vw;
        margin: 8px;
    }

    .sp-panel-header h3 {
        font-size: 17px;
    }

    .sp-avatar {
        width: 90px;
        height: 90px;
    }

    .sp-modal-footer {
        flex-direction: column-reverse;
    }

    .sp-modal-btn {
        width: 100%;
        text-align: center;
    }
}