/* ==========================================================================
   حساب کاربری و ورود — هماهنگ با ui.css (.hp)
   فقط در صفحه‌ی حساب کاربری بارگذاری می‌شود.
   ========================================================================== */

/* ---------- سرتیتر صفحه ---------- */
.hp-account-page { padding-block: clamp(16px, 3vw, 32px) clamp(32px, 5vw, 64px); }
.hp-pagehead {
    margin-bottom: 20px;
    padding: clamp(16px, 2.5vw, 22px) clamp(18px, 3vw, 28px);
    background: var(--hp-soft);
    border: 1px solid var(--hp-line);
    border-radius: 24px;
}
.hp .hp-pagehead__title { margin: 0; font-size: clamp(1.2rem, 2.6vw, 1.6rem); font-weight: 900; line-height: 1.8; color: var(--hp-navy); }

/* ---------- چیدمان ---------- */
.hp-acc { display: grid; gap: 16px; }
@media (min-width: 900px) {
    .hp-acc { grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; }
    .hp-acc__side { position: sticky; top: calc(var(--hp-header-h) + 16px); }
}
.hp-acc__side { border: 1px solid var(--hp-line); border-radius: 22px; background: #fff; overflow: hidden; }
.hp-acc__user { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--hp-soft); border-bottom: 1px solid var(--hp-line); }
.hp-acc__avatar { flex: 0 0 auto; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--hp-navy); color: #fff; font-size: 1.2rem; font-weight: 800; }
.hp-acc__user div { min-width: 0; display: grid; line-height: 1.6; }
.hp-acc__user b { font-weight: 800; color: var(--hp-navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-acc__user span { font-size: .82rem; color: var(--hp-text); text-align: start; }

.hp-acc__nav { padding: 8px; }
.hp-acc__nav ul { display: grid; gap: 2px; }
.hp-acc__nav a, .hp-acc__nav a:visited {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 12px;
    border-radius: 12px;
    font-size: .95rem;
    font-weight: 600;
    color: var(--hp-text);
    transition: background-color .2s, color .2s;
}
.hp-acc__nav a:hover { background: var(--hp-mist); color: var(--hp-navy); }
.hp-acc__nav li.is-active a { background: var(--hp-navy); color: #fff; }
.hp-acc__nav li.woocommerce-MyAccount-navigation-link--customer-logout a { color: var(--hp-sale); }
.hp-acc__nav li.woocommerce-MyAccount-navigation-link--customer-logout a:hover { background: #FDECEF; color: var(--hp-sale); }
.hp-ai { flex: 0 0 auto; }
@media (max-width: 899px) {
    .hp-acc__nav { overflow-x: auto; }
    .hp-acc__nav ul { display: flex; gap: 6px; }
    .hp-acc__nav li { flex: 0 0 auto; }
    .hp-acc__nav a { padding: 0 14px; border: 1px solid var(--hp-line); border-radius: 999px; min-height: 42px; }
    .hp-acc__nav li.is-active a { border-color: var(--hp-navy); }
}

.hp-acc__main .woocommerce-MyAccount-content {
    width: 100%;
    padding: clamp(16px, 3vw, 28px);
    border: 1px solid var(--hp-line);
    border-radius: 22px;
    background: #fff;
}
.hp-acc__main .woocommerce-MyAccount-content h2,
.hp-acc__main .woocommerce-MyAccount-content h3 { margin: 0 0 14px; font-size: 1.15rem; font-weight: 800; color: var(--hp-navy); }

/* ---------- داشبورد ---------- */
.hp-dash__hello {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 20px;
    padding: 20px 22px;
    border: 1px solid var(--hp-line);
    border-radius: 18px;
    background: var(--hp-mist);
}
.hp .hp-dash__title { margin: 0 0 4px; font-size: 1.15rem; font-weight: 800; color: var(--hp-navy); }
.hp-dash__hello p { font-size: .92rem; }
.hp a.hp-dash__logout, .hp a.hp-dash__logout:visited {
    display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px;
    border: 1px solid var(--hp-line); border-radius: 12px; background: #fff; font-size: .9rem; font-weight: 700; color: var(--hp-sale);
}
.hp a.hp-dash__logout:hover { background: #FDECEF; }
.hp-dash__tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .hp-dash__tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.hp a.hp-dash__tile, .hp a.hp-dash__tile:visited {
    display: grid; justify-items: start; gap: 6px; padding: 18px; border: 1px solid var(--hp-line); border-radius: 18px; background: #fff; color: var(--hp-navy);
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.hp a.hp-dash__tile:hover { border-color: var(--hp-blue); box-shadow: 0 10px 24px rgba(0, 47, 93, .08); transform: translateY(-3px); }
.hp-dash__ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--hp-mist); color: var(--hp-navy); }
.hp-dash__tile b { font-weight: 800; font-size: .98rem; }
.hp-dash__tile small { font-size: .8rem; color: var(--hp-text); }

/* ---------- جدول سفارش‌ها ---------- */
.hp .hp-table, .hp table.shop_table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--hp-line); border-radius: 16px; overflow: hidden; }
.hp .hp-table th, .hp table.shop_table th { padding: 12px 14px; background: var(--hp-soft); border-bottom: 1px solid var(--hp-line); font-size: .88rem; font-weight: 800; color: var(--hp-navy); text-align: start; }
.hp .hp-table td, .hp table.shop_table td { padding: 14px; border-bottom: 1px solid var(--hp-line); font-size: .92rem; text-align: start; vertical-align: middle; }
.hp .hp-table tbody tr:last-child td, .hp table.shop_table tbody tr:last-child td { border-bottom: 0; }
.hp .hp-table tbody tr:hover td { background: var(--hp-soft); }
.hp .hp-table td a:not(.button), .hp table.shop_table td a:not(.button) { font-weight: 800; color: var(--hp-blue); }

.hp .hp-status { display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--hp-mist); color: var(--hp-navy); font-size: .8rem; font-weight: 800; line-height: 1.9; }
.hp .hp-status--completed { background: #E3F6E8; color: #1E7A37; }
.hp .hp-status--processing { background: #E6F0F8; color: var(--hp-navy); }
.hp .hp-status--on-hold, .hp .hp-status--pending { background: #FFF3DB; color: #9A6200; }
.hp .hp-status--cancelled, .hp .hp-status--failed, .hp .hp-status--refunded { background: #FDECEF; color: var(--hp-sale); }

@media (max-width: 700px) {
    .hp .hp-table thead { display: none; }
    .hp .hp-table, .hp .hp-table tbody { display: block; border: 0; }
    .hp .hp-table tr { display: block; margin-bottom: 12px; border: 1px solid var(--hp-line); border-radius: 16px; overflow: hidden; }
    .hp .hp-table td { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; text-align: end; }
    .hp .hp-table td::before { content: attr(data-title); font-weight: 800; color: var(--hp-navy); text-align: start; }
}

/* ---------- دکمه‌ها ---------- */
.hp-account-page .button, .hp-account-page button.woocommerce-Button, .hp-account-page a.button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px;
    border: 0; border-radius: 12px; background: var(--hp-navy); color: #fff; font-size: .92rem; font-weight: 800; cursor: pointer; transition: background-color .2s;
}
.hp-account-page .button:hover, .hp-account-page button.woocommerce-Button:hover { background: #00417f; color: #fff; }
.hp-account-page .woocommerce-orders-table__cell-order-actions .button { min-height: 36px; padding: 0 14px; font-size: .85rem; margin-inline-start: 6px; }
.hp-account-page .woocommerce-pagination { display: flex; gap: 8px; margin-top: 16px; }

/* ---------- فرم‌ها ---------- */
.hp-account-page form.woocommerce-EditAccountForm,
.hp-account-page .woocommerce-address-fields__field-wrapper { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.hp-account-page form .clear { display: none; }
.hp-account-page form p.form-row, .hp-account-page form .form-row { margin: 0 0 16px; padding: 0; float: none; width: 100%; }
.hp-account-page form .form-row-wide, .hp-account-page form fieldset, .hp-account-page form > p:not(.form-row) { grid-column: 1 / -1; }
.hp-account-page label { display: block; margin-bottom: 6px; font-size: .9rem; font-weight: 700; color: var(--hp-navy); }
.hp-account-page .required { color: var(--hp-sale); text-decoration: none; }
.hp-account-page input.input-text, .hp-account-page .form-control, .hp-account-page textarea, .hp-account-page select {
    width: 100%; min-height: 48px; padding: 0 14px; border: 1.5px solid var(--hp-line); border-radius: 12px; background: var(--hp-soft);
    font-size: .95rem; color: var(--hp-navy); transition: border-color .2s, background-color .2s, box-shadow .2s; box-shadow: none;
}
.hp-account-page textarea { padding-block: 12px; min-height: 110px; }
.hp-account-page input.input-text:focus, .hp-account-page .form-control:focus, .hp-account-page textarea:focus, .hp-account-page select:focus {
    border-color: var(--hp-blue); background: #fff; box-shadow: 0 0 0 4px rgba(48, 133, 195, .14); outline: 0;
}
.hp-account-page input[readonly] { color: var(--hp-text); background: #EEF1F4; }
.hp-account-page .select2-container .select2-selection--single { height: 48px; border: 1.5px solid var(--hp-line); border-radius: 12px; background: var(--hp-soft); }
.hp-account-page .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 45px; padding-inline: 14px; color: var(--hp-navy); }
.hp-account-page .select2-container--default .select2-selection--single .select2-selection__arrow { height: 46px; }
.hp-account-page .woocommerce-EditAccountForm fieldset { margin: 8px 0 16px; padding: 16px; border: 1px solid var(--hp-line); border-radius: 16px; }
.hp-account-page .woocommerce-EditAccountForm legend { padding-inline: 8px; font-size: 1rem; font-weight: 800; color: var(--hp-navy); }
@media (max-width: 640px) {
    .hp-account-page form.woocommerce-EditAccountForm, .hp-account-page .woocommerce-address-fields__field-wrapper { grid-template-columns: 1fr; }
}

/* ---------- آدرس‌ها ---------- */
.hp-account-page .woocommerce-Addresses { display: grid; gap: 14px; }
@media (min-width: 700px) { .hp-account-page .woocommerce-Addresses { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hp-account-page .woocommerce-Address { width: 100%; padding: 18px; border: 1px solid var(--hp-line); border-radius: 18px; background: var(--hp-soft); }
.hp-account-page .woocommerce-Address-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.hp-account-page .woocommerce-Address-title h3 { margin: 0; }
.hp-account-page .woocommerce-Address-title a.edit { font-size: .88rem; font-weight: 800; color: var(--hp-blue); }
.hp-account-page address { font-style: normal; line-height: 2; }

/* ---------- جزئیات سفارش و اعلان‌ها ---------- */
.hp-account-page mark { padding: 1px 10px; border-radius: 999px; background: var(--hp-mist); color: var(--hp-navy); font-weight: 800; }
.hp-account-page .woocommerce-OrderUpdates { padding: 0; margin: 0 0 16px; list-style: none; }
.hp-account-page .woocommerce-OrderUpdate { margin-bottom: 10px; padding: 12px 16px; border: 1px solid var(--hp-line); border-radius: 14px; }
.hp-account-page .woocommerce-column__title { font-size: 1rem; }

.hp .woocommerce-message, .hp .woocommerce-info, .hp ul.woocommerce-error {
    margin: 0 0 16px; padding: 14px 18px; border: 1px solid var(--hp-line); border-radius: 14px; background: var(--hp-mist); color: var(--hp-navy); list-style: none; font-size: .92rem;
}
.hp .woocommerce-message { background: #E3F6E8; border-color: #BFE6C9; color: #1E7A37; }
.hp ul.woocommerce-error { background: #FDECEF; border-color: #F6C6CE; color: #B3243E; }
.hp .woocommerce-message a.button, .hp .woocommerce-info a.button { margin-inline-start: 10px; min-height: 34px; padding: 0 14px; }

/* ==========================================================================
   صفحه ورود (OTP) — کارت وسط‌چین، بدون هدر و فوتر
   ========================================================================== */
.hp-auth {
    position: relative;
    isolation: isolate;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 16px;
    min-height: 100vh;
    padding: 32px 16px;
    background: var(--hp-soft);
    overflow: hidden;
}
.hp-auth__ring { position: absolute; z-index: -1; border-radius: 50%; border: 1.5px solid rgba(0, 47, 93, .08); aspect-ratio: 1; }
.hp-auth__ring--a { width: min(720px, 120vw); top: -240px; right: -200px; }
.hp-auth__ring--b { width: min(520px, 90vw); bottom: -220px; left: -140px; border-style: dashed; border-color: rgba(48, 133, 195, .25); }

.hp-auth__card {
    width: min(440px, 100%);
    padding: clamp(24px, 5vw, 36px);
    border: 1px solid var(--hp-line);
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(0, 47, 93, .1);
    animation: hp-up .7s cubic-bezier(.2, .7, .2, 1) both;
}
.hp-auth__logo { display: block; margin-bottom: 24px; text-align: center; }
.hp-auth__logo img { display: inline-block; width: min(220px, 70%); height: auto; }
.hp .hp-auth__title { margin: 0 0 6px; font-size: 1.35rem; font-weight: 900; line-height: 1.7; text-align: center; color: var(--hp-navy); }
.hp .hp-auth__title--sm { font-size: 1rem; font-weight: 800; margin-bottom: 4px; }
.hp .hp-auth__hint { display: block; margin-bottom: 14px; font-size: .92rem; text-align: center; color: var(--hp-text); }

.registerForm, .enterOtp { gap: 0; }
.enterOtp.d-flex { display: flex !important; }
.hp-field { position: relative; margin-bottom: 14px; }
.hp-field svg { position: absolute; top: 50%; right: 16px; translate: 0 -50%; color: #8496A8; pointer-events: none; }
.hp .hp-field input {
    width: 100%; height: 54px; padding: 0 46px 0 16px; border: 1.5px solid var(--hp-line); border-radius: 14px; background: var(--hp-soft);
    font-size: 1.05rem; font-weight: 700; letter-spacing: .08em; color: var(--hp-navy); text-align: right; box-shadow: none; transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.hp .hp-field input::placeholder { color: #A5B3C2; font-weight: 500; letter-spacing: .04em; }
.hp .hp-field input:focus { border-color: var(--hp-blue); background: #fff; box-shadow: 0 0 0 4px rgba(48, 133, 195, .14); outline: 0; }

.hp button.hp-auth__btn {
    display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 0 20px; border: 0; border-radius: 14px;
    background: var(--hp-navy); color: #fff; font-size: 1rem; font-weight: 800; cursor: pointer; transition: background-color .2s, opacity .2s;
}
.hp button.hp-auth__btn:hover:not(:disabled) { background: #00417f; }
.hp button.hp-auth__btn:disabled { opacity: .5; cursor: not-allowed; }

.hp .invalidPhoneEntered { display: block; min-height: 1.4em; margin-top: 10px; font-size: .85rem; font-weight: 700; text-align: center; color: var(--hp-sale); }
.hp .hp-auth__note { display: block; margin-top: 6px; font-size: .78rem; line-height: 1.9; text-align: center; color: #8496A8; }
.hp .hp-auth__timer { margin: 4px 0 14px; font-size: .88rem; text-align: center; color: var(--hp-text); }
.hp #resendOTP { align-items: center; justify-content: center; margin: 4px 0 14px; font-size: .9rem; font-weight: 800; color: var(--hp-blue); cursor: pointer; }
.hp #otpAlert { margin-top: 10px; font-size: .85rem; font-weight: 700; text-align: center; color: var(--hp-sale); }
.hp button.hp-auth__back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; padding: 4px 10px 4px 4px; border: 0; border-radius: 999px; background: transparent; font-size: .88rem; font-weight: 700; color: var(--hp-text); cursor: pointer; }
.hp button.hp-auth__back:hover { background: var(--hp-mist); color: var(--hp-navy); }
.hp a.hp-auth__home, .hp a.hp-auth__home:visited { font-size: .9rem; font-weight: 700; color: var(--hp-text); }
.hp a.hp-auth__home:hover { color: var(--hp-navy); text-decoration: underline; text-underline-offset: 5px; }
