﻿/* ================= ROOT ================= */
.profile-page {
    padding: 20px;
    background: #f6f7f9;
    max-width: 100%;
    overflow-x: hidden;
}

/* ================= HEADER ================= */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

    .profile-header h2 {
        margin: 0;
        font-size: 22px;
    }

.profile-subtitle {
    font-size: 13px;
    color: #777;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-change-password {
    background: #000;
    color: #fff;
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

    .btn-change-password:hover {
        background: #222;
    }

/* ================= BODY ================= */
.profile-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 820px;
}

/* ================= AVATAR CARD ================= */
.profile-avatar-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.avatar-circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
    letter-spacing: 1px;
}

.avatar-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.avatar-name {
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.avatar-role {
    font-size: 13px;
    color: #555;
    text-transform: capitalize;
}

.avatar-alias {
    font-size: 12px;
    color: #999;
    font-family: monospace;
    letter-spacing: 0.5px;
}

/* ================= DETAILS CARD ================= */
.profile-details-card {
    background: #fff;
    border-radius: 8px;
    padding: 22px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.card-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 16px;
}

.readonly-badge {
    background: #f0f0f0;
    color: #888;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: none;
}

.card-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

/* ================= PROFILE GRID ================= */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .profile-field.full-width {
        grid-column: 1 / -1;
    }

.field-label {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.field-value {
    font-size: 14px;
    color: #222;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 9px 12px;
    min-height: 38px;
    display: flex;
    align-items: center;
    cursor: default;
    user-select: all;
}

    .field-value.mono {
        font-family: 'Courier New', Courier, monospace;
        font-size: 13px;
        color: #333;
        letter-spacing: 0.3px;
    }

    .field-value.company-name {
        font-weight: 600;
        font-size: 15px;
        color: #111;
    }

/* ============================================================
   CHANGE PASSWORD MODAL
============================================================ */

/* Overlay */
.cp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sheet */
.cp-modal-sheet {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    padding: 0 0 24px 0;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    animation: cpSlideUp 0.22s ease-out;
    margin: 0 16px;
}

@keyframes cpSlideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Drag handle */
.cp-modal-handle {
    width: 36px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 12px auto 0;
}

/* Header */
.cp-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.cp-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #111;
}

.cp-modal-subtitle {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.cp-modal-close {
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 13px;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s;
}

    .cp-modal-close:hover {
        background: #eee;
    }

/* Body */
.cp-modal-body {
    padding: 20px 20px 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cp-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cp-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cp-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.cp-input {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid #ddd;
    border-radius: 7px;
    font-size: 14px;
    color: #222;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

    .cp-input:focus {
        border-color: #111;
        box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
    }

.cp-eye-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: #999;
    padding: 4px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
}

    .cp-eye-btn:hover {
        opacity: 1;
    }

/* Password strength */
.cp-strength-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: -4px;
}

.cp-strength-label {
    font-size: 12px;
    color: #888;
    flex-shrink: 0;
}

.cp-strength-bar {
    flex: 1;
    height: 5px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.cp-strength-fill {
    height: 100%;
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease, background 0.3s ease;
}

.cp-strength-text {
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    min-width: 50px;
}

/* Footer */
.cp-modal-footer {
    padding: 16px 20px 0;
    display: flex;
    gap: 10px;
    border-top: 1px solid #f0f0f0;
}

.cp-btn-cancel {
    flex: 1;
    padding: 11px;
    background: #f5f5f5;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: background 0.15s;
}

    .cp-btn-cancel:hover {
        background: #eee;
    }

.cp-btn-submit {
    flex: 2;
    padding: 11px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

    .cp-btn-submit:hover {
        background: #333;
    }

    .cp-btn-submit:disabled {
        background: #aaa;
        cursor: not-allowed;
    }

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    .profile-page {
        padding: 10px;
    }

    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-field.full-width {
        grid-column: 1;
    }

    .profile-avatar-card {
        padding: 16px 18px;
    }

    .cp-modal-sheet {
        border-radius: 12px 12px 0 0;
        max-width: 100%;
        margin: 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }

    .cp-modal-overlay {
        align-items: flex-end;
    }
}

@media (max-width: 480px) {
    .profile-header h2 {
        font-size: 18px;
    }

    .avatar-circle {
        width: 54px;
        height: 54px;
        font-size: 20px;
    }

    .avatar-name {
        font-size: 16px;
    }
}
