﻿/* Member profile */

.member-profile {
    max-width: 1000px;
    margin: 24px auto 40px;
    padding: clamp(18px, 4vw, 40px);
    border: 1px solid #29384d;
    border-radius: 24px;
    background: linear-gradient(160deg, #182334, #0e1420 55%);
    color: #edf2fb;
    overflow-wrap: anywhere;
}

.member-profile-toolbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
}

.member-profile-label {
    color: #a9b6c9;
    text-align: center;
    font-size: 0.8rem;
    letter-spacing: 0.16em;
}

.member-icon-button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid #30415a;
    border-radius: 50%;
    background: #101927;
    color: #edf2fb;
    text-decoration: none;
    font-size: 1.8rem;
    line-height: 1;
}

    .member-icon-button:hover {
        border-color: #8caaff;
        background: #20314a;
        color: #fff;
    }

    .member-icon-button svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

/* Identity */

.member-profile-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 38px 0 42px;
    text-align: center;
}

.member-avatar {
    display: grid;
    place-items: center;
    width: 144px;
    height: 144px;
    margin-bottom: 24px;
    overflow: hidden;
    border: 3px solid #6e94ff;
    border-radius: 50%;
    background: linear-gradient(140deg, #345cff, #172c67);
    box-shadow: 0 0 28px rgb(74 117 255 / 16%);
    color: #fff;
    font-size: 3.4rem;
    font-weight: 700;
}

    .member-avatar img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.member-profile-identity h1 {
    max-width: 100%;
    margin: 0 0 8px;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 750;
    letter-spacing: -0.04em;
}

.member-handle {
    margin: 0 0 12px;
    color: #96b4ff;
    font-size: 1.1rem;
}

.member-location {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: #a9b6c9;
}

    .member-location svg {
        flex-shrink: 0;
        width: 19px;
        height: 19px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.6;
    }

.member-bio {
    max-width: 540px;
    margin: 20px 0 0;
    color: #c3cee0;
    line-height: 1.7;
    white-space: pre-line;
}

.member-edit-button {
    min-height: 44px;
    margin-top: 24px;
    padding: 10px 24px;
    border-color: #5274bd;
    border-radius: 12px;
    color: #c5d6ff;
}

    .member-edit-button:hover {
        border-color: #779cff;
        background: #345cff;
        color: #fff;
    }

.member-profile-hint {
    max-width: 340px;
    margin: 14px 0 0;
    color: #a9b6c9;
    font-size: 0.85rem;
}

/* Garage */

.member-garage {
    max-width: 760px;
    margin: 0 auto;
    padding-top: 24px;
    border-top: 1px solid #29384d;
}

.member-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

    .member-section-heading h2 {
        margin: 0;
        color: #c6d2e5;
        font-size: 0.9rem;
        font-weight: 600;
        letter-spacing: 0.13em;
        text-transform: uppercase;
    }

    .member-section-heading a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        color: #a7bdff;
        text-decoration: none;
    }

        .member-section-heading a:hover {
            color: #fff;
        }

.member-garage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.member-vehicle-card {
    position: relative;
    display: block;
    min-width: 0;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 1px solid #354964;
    border-radius: 20px;
    background: #172232;
    color: #fff;
    text-decoration: none;
}

    .member-vehicle-card:hover {
        border-color: #8caaff;
        color: #fff;
    }

    .member-vehicle-card > img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.member-vehicle-placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    padding: 20px;
    color: #a9b6c9;
    text-align: center;
    background: linear-gradient(135deg, #243955, #111925);
}

.member-vehicle-visibility {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 10px;
    border: 1px solid rgb(255 255 255 / 20%);
    border-radius: 999px;
    background: rgb(10 18 30 / 80%);
    color: #e2eaff;
    font-size: 0.75rem;
}

.member-vehicle-caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 50px 18px 18px;
    background: linear-gradient(transparent, rgb(5 10 18 / 95%));
}

    .member-vehicle-caption h3 {
        margin: 0 0 6px;
        font-size: 1.25rem;
        font-weight: 700;
    }

    .member-vehicle-caption p {
        margin: 0 0 6px;
        font-size: 0.95rem;
        line-height: 1.4;
    }

    .member-vehicle-caption > span {
        color: #b8c9e5;
        font-size: 0.85rem;
    }

.member-add-vehicle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    min-width: 0;
    aspect-ratio: 4 / 5;
    padding: 16px;
    border: 1px dashed #435878;
    border-radius: 20px;
    background: #101927;
    color: #c0cfe5;
    text-align: center;
    text-decoration: none;
}

    .member-add-vehicle > span {
        color: #8caaff;
        font-size: 2.6rem;
        line-height: 1;
    }

    .member-add-vehicle:hover {
        border-color: #8caaff;
        background: #192a42;
        color: #fff;
    }

.member-garage-empty {
    margin: 0;
    padding: 24px 0;
    color: #a9b6c9;
}

.member-profile a:focus-visible {
    outline: 2px solid #a7bdff;
    outline-offset: 4px;
}

/* Profile modal */

#profileFormError {
    white-space: pre-line;
}

#editProfileModal .form-text {
    color: #a9b6c9;
}

#editProfileModal .modal-footer .btn {
    min-height: 44px;
    white-space: nowrap;
}

/* Mobile */

@media (max-width: 600px) {
    .member-profile {
        padding: 18px;
        border-radius: 20px;
    }

    .member-profile-label {
        font-size: 0.7rem;
        letter-spacing: 0.1em;
    }

    .member-profile-identity {
        padding: 30px 0;
    }

    .member-avatar {
        width: 120px;
        height: 120px;
        margin-bottom: 20px;
        font-size: 2.8rem;
    }

    .member-location {
        font-size: 0.9rem;
    }

    .member-garage-grid {
        gap: 12px;
    }

    .member-vehicle-card,
    .member-add-vehicle {
        border-radius: 14px;
    }

    .member-vehicle-caption {
        padding: 40px 12px 12px;
    }

        .member-vehicle-caption h3 {
            font-size: 1rem;
        }

        .member-vehicle-caption p {
            font-size: 0.8rem;
        }

    .member-vehicle-visibility {
        top: 8px;
        left: 8px;
        font-size: 0.65rem;
    }
}

/* Profile gear button */

button.member-icon-button {
    border: 0;
    background: transparent;
}

    button.member-icon-button:hover {
        background: transparent;
        color: #a7bdff;
    }

    button.member-icon-button:focus-visible {
        outline: 2px solid #a7bdff;
        outline-offset: 3px;
    }

/* Avatar camera control */

.member-avatar-wrapper {
    position: relative;
    margin-bottom: 24px;
}

    .member-avatar-wrapper .member-avatar {
        margin-bottom: 0;
    }

.member-camera-button {
    position: absolute;
    right: -4px;
    bottom: -2px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 3px solid #152031;
    border-radius: 50%;
    background: #345cff;
    color: #fff;
}

    .member-camera-button:hover {
        background: #5276ff;
    }

    .member-camera-button svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.8;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .member-camera-button:focus-visible {
        outline: 2px solid #a7bdff;
        outline-offset: 3px;
    }

/* Photo modal preview */

.profile-photo-preview {
    display: grid;
    place-items: center;
    width: min(220px, 100%);
    aspect-ratio: 1;
    margin: 0 auto 24px;
    overflow: hidden;
    border: 2px solid #6e94ff;
    border-radius: 50%;
    background: #101927;
    color: #a9b6c9;
}

    .profile-photo-preview img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .profile-photo-preview > span {
        padding: 20px;
        text-align: center;
    }

#profilePhotoError {
    white-space: pre-line;
}

#profilePhotoModal .form-text {
    color: #a9b6c9;
}

#profilePhotoModal .modal-footer .btn {
    min-height: 44px;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .member-avatar-wrapper {
        margin-bottom: 20px;
    }

    #profilePhotoModal .modal-footer {
        flex-wrap: wrap;
        gap: 8px;
        padding: 14px;
    }

        #profilePhotoModal .modal-footer .btn {
            flex: 1;
            margin: 0 !important;
        }

    #profilePhotoModal #profilePhotoSubmit,
    #profilePhotoModal #profilePhotoConfirmRemove {
        order: -1;
        flex-basis: 100%;
    }
}

/* Profile settings */

.member-settings-link {
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: #9cacc3;
}

    .member-settings-link:hover {
        border-color: transparent;
        background: #1b2a40;
        color: #e1ebff;
    }

    .member-settings-link svg {
        width: 25px;
        height: 25px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.member-settings {
    max-width: 760px;
}

.member-settings-title {
    margin: 0;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
}

.member-settings-intro {
    margin: 28px 0 32px;
    color: #a9b6c9;
}

.member-settings-section-title {
    margin-bottom: 14px;
    color: #a9b6c9;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.member-settings-list {
    display: grid;
    gap: 12px;
}

.member-settings-row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 18px;
    border: 1px solid #2e3e54;
    border-radius: 18px;
    background: #192536;
    color: #edf2fb;
    font: inherit;
    text-align: left;
}

    .member-settings-row:hover:not(:disabled) {
        border-color: #6487e6;
        background: #20314a;
    }

.member-settings-icon {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #263c69;
    color: #a7bdff;
}

    .member-settings-icon svg {
        width: 24px;
        height: 24px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

.member-settings-row-text {
    flex: 1;
    min-width: 0;
}

    .member-settings-row-text strong {
        display: block;
        margin-bottom: 4px;
        font-size: 1.05rem;
        font-weight: 600;
    }

    .member-settings-row-text > span {
        display: block;
        color: #a9b6c9;
        font-size: 0.85rem;
        line-height: 1.5;
    }

.member-settings-chevron {
    color: #91a4c0;
    font-size: 1.8rem;
}

.member-settings-danger .member-settings-icon {
    background: #432634;
    color: #ff9fb3;
}

.member-settings-danger strong {
    color: #ffb0c0;
}

.member-settings-row:disabled {
    opacity: 0.6;
    cursor: default;
}

.member-settings-row:focus-visible {
    outline: 2px solid #a7bdff;
    outline-offset: 4px;
}

@media (max-width: 600px) {
    .member-settings-row {
        gap: 12px;
        padding: 14px;
    }

    .member-settings-row-text strong {
        font-size: 1rem;
    }

    .member-settings-row-text > span {
        font-size: 0.8rem;
    }
}

/* Account deletion confirmation */

#deleteProfileError {
    white-space: pre-line;
}

#deleteProfileModal .form-text {
    color: #a9b6c9;
}

#deleteProfileModal .modal-footer .btn {
    min-height: 44px;
    white-space: nowrap;
}

@media (max-width: 600px) {
    #deleteProfileModal .modal-footer {
        gap: 8px;
        padding: 14px;
    }

        #deleteProfileModal .modal-footer .btn {
            flex-basis: 100%;
            margin: 0;
        }
}

a.member-settings-row {
    text-decoration: none;
}

.member-policy {
    color: #c8d5e9;
    line-height: 1.7;
}

    .member-policy h1 {
        color: #fff;
        font-size: 1.8rem;
    }

    .member-policy h2 {
        margin: 28px 0 10px;
        color: #edf2fb;
        font-size: 1.1rem;
    }

.member-policy-date {
    color: #9cacc3;
    font-size: 0.85rem;
}

.member-policy a {
    color: #a7bdff;
}

.member-policy li {
    margin-bottom: 8px;
}