* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f5f6fa;
    color: #172033;
    font-family: Arial, Helvetica, sans-serif;
}

.profile-topbar {
    min-height: 68px;
    padding: 0 6%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-bottom: 1px solid #e9eaf0;
}

.profile-brand {
    color: #172033;
    font-size: 25px;
    font-weight: 800;
    text-decoration: none;
    letter-spacing: -1px;
}

.back-home {
    color: #4f46e5;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.profile-page {
    width: min(900px, 92%);
    margin: 42px auto;
}

.profile-heading {
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 8px;
    color: #6366f1;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
}

.profile-heading h1 {
    margin: 0 0 8px;
    font-size: clamp(28px, 5vw, 38px);
}

.profile-heading > p:last-child {
    margin: 0;
    color: #6b7280;
    line-height: 1.6;
}

.profile-card {
    padding: 30px;
    background: #fff;
    border: 1px solid #e9eaf0;
    border-radius: 18px;
    box-shadow: 0 8px 30px rgba(20, 30, 60, 0.05);
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 25px;
    margin-bottom: 25px;
    border-bottom: 1px solid #edf0f4;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 26px;
    font-weight: 800;
    text-transform: uppercase;
}

.profile-hero h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.profile-hero p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
}

.profile-field span {
    font-size: 14px;
    font-weight: 700;
}

.profile-field input,
.profile-field textarea {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #dfe3eb;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: #172033;
    font: inherit;
    font-size: 14px;
}

.profile-field input:focus,
.profile-field textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.profile-field input[readonly] {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.profile-field textarea {
    resize: vertical;
    min-height: 110px;
}

.profile-field small {
    color: #858b98;
    font-size: 11px;
    line-height: 1.4;
}

.full-width {
    grid-column: 1 / -1;
}

.save-profile-btn {
    margin-top: 24px;
    padding: 14px 24px;
    border: 0;
    border-radius: 10px;
    background: #4f46e5;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.save-profile-btn:hover {
    background: #4338ca;
}

.save-profile-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.profile-links {
    display: grid;
    gap: 13px;
    margin-top: 20px;
}

.profile-link-card {
    width: 100%;
    min-height: 78px;
    padding: 16px 19px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #e9eaf0;
    border-radius: 14px;
    background: #fff;
    color: #172033;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.link-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #f0f2ff;
    font-size: 20px;
}

.profile-link-card > span:nth-child(2) {
    flex: 1;
}

.profile-link-card strong,
.profile-link-card small {
    display: block;
}

.profile-link-card strong {
    margin-bottom: 5px;
    font-size: 14px;
}

.profile-link-card small {
    color: #777f8e;
    font-size: 12px;
}

.link-arrow {
    color: #8b91a0;
    font-size: 26px;
}

.logout-card {
    font-family: inherit;
}

.logout-card .link-icon {
    background: #fff0f0;
}

.logout-card strong {
    color: #dc2626;
}

.profile-message {
    display: none;
    padding: 12px 15px;
    margin-bottom: 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.profile-message.show {
    display: block;
}

.profile-message.success {
    background: #eaf8ef;
    color: #18743b;
}

.profile-message.error {
    background: #fff0f0;
    color: #b42318;
}

.profile-footer {
    padding: 25px 15px;
    color: #858b98;
    text-align: center;
    font-size: 12px;
}

@media (max-width: 600px) {
    .profile-topbar {
        min-height: 60px;
        padding: 0 4%;
    }

    .profile-page {
        width: 92%;
        margin: 26px auto;
    }

    .profile-card {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 17px;
    }

    .full-width {
        grid-column: auto;
    }

    .save-profile-btn {
        width: 100%;
    }
}