/* ===========================================
   profi - Profile Page Styles
   =========================================== */

/* ===========================================
   PROFILE MAIN
   =========================================== */
.profile-main {
    background-color: var(--gray-100);
    min-height: calc(100vh - 200px);
    padding: calc(var(--space) * 8) 0;
}

.profile-main .container {
    max-width: 800px;
}

/* ===========================================
   NOT LOGGED IN STATE
   =========================================== */
.profile-not-logged-in {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    padding: calc(var(--space) * 10);
    background-color: #fff;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
}

.profile-not-logged-in__icon {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gray-100);
    border-radius: var(--radius-pill);
    color: var(--gray-600);
    margin-bottom: calc(var(--space) * 6);
}

.profile-not-logged-in__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: calc(var(--space) * 3);
    padding-bottom: 0;
}

.profile-not-logged-in__text {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: calc(var(--space) * 6);
}

/* ===========================================
   PROFILE HEADER
   =========================================== */
.profile-header {
    margin-bottom: calc(var(--space) * 8);
}

.profile-header__title {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: calc(var(--space) * 2);
    padding-bottom: 0;
}

.profile-header__subtitle {
    font-size: 1rem;
    color: var(--gray-600);
}

/* ===========================================
   PROFILE CARDS
   =========================================== */
.profile-card {
    background-color: #fff;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-lg);
    margin-bottom: calc(var(--space) * 6);
    overflow: hidden;
}

.profile-card__header {
    padding: calc(var(--space) * 5) calc(var(--space) * 6);
    background-color: var(--gray-100);
    border-bottom: 1px solid var(--gray-300);
}

.profile-card__title {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--secondary);
    margin: 0;
    padding-bottom: 0;
}

.profile-card__body {
    padding: calc(var(--space) * 6);
}

/* ===========================================
   FORM GRID
   =========================================== */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: calc(var(--space) * 5);
}

.form-row {
    display: block;
    width: 100%;
}

.form-row--2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: calc(var(--space) * 4);
    align-items: start;
}

.form-row u-field,
.form-row--2col u-field {
    display: block;
    width: 100%;
}

/* ===========================================
   UNIDY FIELD STYLING
   =========================================== */
u-field {
    display: block !important;
    width: 100% !important;
}

u-field::part(field-container) {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: calc(var(--space) * 2);
    width: 100%;
}

u-field::part(field_label) {
    display: block !important;
    width: 100%;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-500);
    margin-bottom: calc(var(--space) * 1);
    order: -1;
}

u-field::part(input_field),
u-field::part(select_field),
u-field::part(textarea_field) {
    display: block !important;
    width: 100% !important;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text);
    background-color: #fff;
    border: 1px solid var(--secondary-400);
    border-radius: var(--radius-pill);
    padding: calc(var(--space) * 3) calc(var(--space) * 4);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

u-field::part(input_field):focus,
u-field::part(select_field):focus,
u-field::part(textarea_field):focus {
    outline: none;
    border-color: var(--gray-600);
    box-shadow: var(--focus-ring);
}

u-field::part(select_field) {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B8299' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

u-field::part(required-indicator) {
    color: var(--primary);
    margin-left: calc(var(--space) * 1);
}

u-field::part(radio-group_field) {
    display: flex;
    gap: calc(var(--space) * 4);
    flex-wrap: wrap;
}

u-field::part(radio-group-item_label) {
    display: flex;
    align-items: center;
    gap: calc(var(--space) * 2);
    padding: calc(var(--space) * 2) calc(var(--space) * 4);
    background-color: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: var(--text-sm);
}

u-field::part(radio-group-item_label):hover {
    border-color: var(--primary);
}

u-field::part(radio_checked) {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ===========================================
   PROFILE SUBMIT
   =========================================== */
.profile-submit {
    display: flex;
    justify-content: flex-end;
    margin-bottom: calc(var(--space) * 4);
}

.profile-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--space) * 4) calc(var(--space) * 8);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background-color: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background-color 0.2s ease;
    min-height: 48px;
}

.profile-submit-btn:hover {
    background-color: var(--primary-800);
}

/* ===========================================
   PROFILE UPDATE MESSAGES
   =========================================== */
.profile-update-message {
    margin-top: calc(var(--space) * 4);
}

.profile-message {
    display: flex;
    align-items: center;
    gap: calc(var(--space) * 3);
    padding: calc(var(--space) * 4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.profile-message--success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.profile-message--error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ===========================================
   LOGOUT SECTION
   =========================================== */
.profile-card--logout {
    background-color: var(--gray-100);
    border-color: var(--gray-300);
}

.profile-card--logout .profile-card__body {
    padding: calc(var(--space) * 5) calc(var(--space) * 6);
}

.logout-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(var(--space) * 4);
}

.logout-section__info {
    flex: 1;
}

.logout-section__title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: calc(var(--space) * 1);
}

.logout-section__text {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin: 0;
}

.logout-btn {
    flex-shrink: 0;
    padding: calc(var(--space) * 3) calc(var(--space) * 6);
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 767px) {
    .profile-header__title {
        font-size: 1.5rem;
    }

    .profile-card__header {
        padding: calc(var(--space) * 4);
    }

    .profile-card__body {
        padding: calc(var(--space) * 4);
    }

    .form-row--2col {
        grid-template-columns: 1fr;
    }

    .profile-submit {
        justify-content: stretch;
    }

    .profile-submit-btn {
        width: 100%;
    }

    .logout-section {
        flex-direction: column;
        text-align: center;
    }

    .logout-section__info {
        margin-bottom: calc(var(--space) * 4);
    }

    .logout-btn {
        width: 100%;
    }
}
