/* ===============================================================
   ShopPro — customer account and auth pages
   =============================================================== */

/* ---------------- Auth cards ---------------- */

.auth-card {
    max-width: 440px; margin: 40px auto 60px;
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--r-lg); padding: 32px;
}
.auth-card h1 { font-size: 24px; font-weight: 750; letter-spacing: -.5px; margin: 0 0 6px; }
.auth-sub { color: var(--muted); font-size: 14px; margin: 0 0 24px; }

.auth-card .field { margin-bottom: 16px; }
.auth-card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.auth-card .opt { font-weight: 400; color: var(--muted); }
.auth-card input[type="text"], .auth-card input[type="email"],
.auth-card input[type="tel"], .auth-card input[type="password"],
.auth-card input[type="date"], .auth-card select {
    width: 100%; padding: 10px 13px; border: 1px solid var(--line);
    border-radius: var(--r-sm); font: inherit; font-size: 14px; background: var(--white);
}
.auth-card input:focus, .auth-card select:focus {
    outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}
.auth-card input.is-invalid { border-color: var(--red); }
.auth-card .hint { font-size: 12px; color: var(--muted); margin: 5px 0 0; font-weight: 400; }
.auth-card .err { font-size: 12px; color: var(--red); margin: 5px 0 0; font-weight: 600; }

.auth-row { display: flex; align-items: center; justify-content: space-between;
            gap: 12px; margin: 4px 0 20px; font-size: 13.5px; }
.auth-row a { color: var(--blue); }

.auth-foot { text-align: center; font-size: 14px; color: var(--muted); margin: 18px 0 0; }
.auth-foot a { color: var(--blue); font-weight: 600; }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px;
         font-weight: 400 !important; cursor: pointer; color: var(--ink-2); }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--blue);
               cursor: pointer; flex: 0 0 16px; }

/* ---------------- Account layout ---------------- */

.acct-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr);
               gap: 26px; align-items: start; padding-bottom: 44px; }

.acct-nav { background: var(--white); border: 1px solid var(--line);
            border-radius: var(--r-lg); overflow: hidden; position: sticky; top: 96px; }

.acct-who { display: flex; align-items: center; gap: 11px; padding: 18px;
            border-bottom: 1px solid var(--line); }
.acct-avatar { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 999px;
               background: var(--navy); color: #fff; display: grid; place-items: center;
               font-size: 14px; font-weight: 700; }
.acct-who strong { display: block; font-size: 14px; line-height: 1.3; }
.acct-who small { display: block; font-size: 12px; color: var(--muted);
                  overflow: hidden; text-overflow: ellipsis; }

.acct-nav nav { padding: 8px; }
.acct-nav nav a { display: block; padding: 9px 12px; border-radius: var(--r-sm);
                  font-size: 13.5px; color: var(--ink-2); }
.acct-nav nav a:hover { background: var(--line-2); color: var(--blue); }
.acct-nav nav a.is-active { background: var(--navy); color: #fff; font-weight: 600; }

.acct-signout { padding: 8px 8px 14px; border-top: 1px solid var(--line); margin-top: 4px; }
.acct-signout button { width: 100%; padding: 9px 12px; border: 1px solid var(--line);
                       border-radius: var(--r-sm); background: var(--white);
                       font: inherit; font-size: 13.5px; color: var(--red); cursor: pointer; }
.acct-signout button:hover { background: #fef2f2; border-color: #fecaca; }

.acct-main { min-width: 0; }

/* ---------------- Stats ---------------- */

.acct-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
              gap: 14px; margin-bottom: 22px; }
.acct-stat { background: var(--white); border: 1px solid var(--line);
             border-radius: var(--r-lg); padding: 18px; text-align: center;
             transition: border-color .12s, transform .12s; }
a.acct-stat:hover { border-color: var(--blue); transform: translateY(-2px); }
.acct-stat strong { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
.acct-stat span { font-size: 12.5px; color: var(--muted); }

/* ---------------- Panels ---------------- */

.acct-panel { background: var(--white); border: 1px solid var(--line);
              border-radius: var(--r-lg); padding: 22px; margin-bottom: 18px; }
.acct-panel-head { display: flex; align-items: center; justify-content: space-between;
                   gap: 12px; margin-bottom: 16px; }
.acct-panel-head h2 { font-size: 16px; font-weight: 700; margin: 0; }
.acct-panel-head a { font-size: 13.5px; color: var(--blue); font-weight: 600; }

.acct-panel .field { margin-bottom: 15px; }
.acct-panel label { display: block; font-size: 13px; font-weight: 600;
                    margin-bottom: 6px; color: var(--ink-2); }
.acct-panel .opt { font-weight: 400; color: var(--muted); }
.acct-panel input[type="text"], .acct-panel input[type="email"], .acct-panel input[type="tel"],
.acct-panel input[type="password"], .acct-panel input[type="date"], .acct-panel select {
    width: 100%; padding: 10px 13px; border: 1px solid var(--line);
    border-radius: var(--r-sm); font: inherit; font-size: 14px; background: var(--white);
}
.acct-panel input:disabled { background: var(--line-2); color: var(--muted); }
.acct-panel input:focus, .acct-panel select:focus {
    outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}
.acct-panel input.is-invalid { border-color: var(--red); }
.acct-panel .hint { font-size: 12px; color: var(--muted); margin: 5px 0 0; font-weight: 400; }
.acct-panel .err { font-size: 12px; color: var(--red); margin: 5px 0 0; font-weight: 600; }

.acct-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---------------- Order rows ---------------- */

.acct-orders { display: flex; flex-direction: column; gap: 10px; }
.acct-order { display: flex; align-items: center; gap: 16px;
              border: 1px solid var(--line); border-radius: var(--r);
              padding: 14px 16px; background: var(--white);
              transition: border-color .12s, transform .12s; }
.acct-order:hover { border-color: var(--blue); transform: translateY(-1px); }
.acct-order > div:first-child { flex: 1; min-width: 0; }
.acct-order strong { display: block; font-size: 14px; }
.acct-order small { display: block; font-size: 12.5px; color: var(--muted); }
.acct-order-total { font-weight: 700; font-size: 15px; white-space: nowrap; }

.track-row { display: flex; align-items: center; justify-content: space-between;
             gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.track-row:last-child { border-bottom: 0; }
.track-row strong { display: block; font-size: 14px; }
.track-row small { display: block; font-size: 12.5px; color: var(--muted); }
.track-row code { background: var(--line-2); padding: 4px 9px; border-radius: 5px; font-size: 12.5px; }

/* ---------------- Addresses ---------------- */

.addr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
             gap: 14px; margin-bottom: 20px; }
.addr-card { background: var(--white); border: 1px solid var(--line);
             border-radius: var(--r-lg); padding: 18px; position: relative; }
.addr-card.is-default { border-color: var(--blue); }
.addr-card h3 { font-size: 14px; margin: 8px 0 6px; }
.addr-card p { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); margin: 0 0 12px; }
.addr-actions { display: flex; gap: 12px; }
.addr-actions form { margin: 0; }
.addr-actions button { background: none; border: 0; padding: 0; font: inherit;
                       font-size: 12.5px; color: var(--blue); cursor: pointer; text-decoration: underline; }
.addr-actions button.danger { color: var(--red); }

/* ---------------- Timeline (shared with admin) ---------------- */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px;
                    width: 2px; background: var(--line); }
.timeline li { display: flex; gap: 14px; padding: 0 0 18px; position: relative; }
.timeline li:last-child { padding-bottom: 0; }
.timeline-dot { flex: 0 0 12px; width: 12px; height: 12px; border-radius: 999px;
                background: var(--white); border: 2px solid var(--blue);
                margin-top: 4px; position: relative; z-index: 1; }
.timeline-head { margin: 0 0 4px; font-size: 13.5px; }
.timeline-body { margin: 0 0 4px; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.timeline-meta { margin: 0; font-size: 12px; color: var(--muted); }

.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
    .acct-layout { grid-template-columns: 1fr; }
    .acct-nav { position: static; }
    .acct-nav nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .acct-nav nav a { flex: 1 1 auto; text-align: center; }
    .acct-cols { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .acct-order { flex-wrap: wrap; }
    .acct-order-total { width: 100%; }
    .grid-3 { grid-template-columns: 1fr; }
    .auth-card { padding: 24px; margin: 24px auto 40px; }
}

/* ---------------- Return request ---------------- */

.return-items { display: flex; flex-direction: column; gap: 4px; }
.return-item { display: flex; align-items: center; gap: 14px;
               padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.return-item:last-child { border-bottom: 0; }
.return-item-info { flex: 1; min-width: 0; }
.return-item-info strong { display: block; font-size: 14px; line-height: 1.4; }
.return-item-info small { display: block; font-size: 12.5px; color: var(--muted); }
.return-item-qty select { padding: 8px 11px; border: 1px solid var(--line);
                          border-radius: var(--r-sm); font: inherit; font-size: 13.5px;
                          background: var(--white); min-width: 92px; }
.return-item-qty select:focus { outline: none; border-color: var(--blue);
                                box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }

.return-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.return-note { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; line-height: 1.6; }
.return-reject { color: var(--red) !important; font-weight: 600; }

/* ---------------- Wishlist rows ---------------- */

.wish-list { display: flex; flex-direction: column; gap: 12px; }

.wish-row { display: flex; align-items: center; gap: 18px;
            background: var(--white); border: 1px solid var(--line);
            border-radius: var(--r-lg); padding: 16px 18px;
            transition: border-color .12s, transform .12s; }
.wish-row:hover { border-color: var(--blue); transform: translateY(-1px); }
.wish-row.is-unavailable { opacity: .72; }

.wish-info { flex: 1; min-width: 0; }
.wish-info h3 { font-size: 15px; margin: 0 0 4px; font-weight: 650; }
.wish-info h3 a { color: inherit; }
.wish-info h3 a:hover { color: var(--blue); }
.wish-meta { font-size: 12.5px; color: var(--muted); margin: 0; }

.wish-flag { font-size: 12.5px; font-weight: 600; margin: 6px 0 0; }
.wish-flag-drop { color: var(--green, #16a34a); }
.wish-flag-out { color: var(--red); }

.wish-price { text-align: right; white-space: nowrap; }
.wish-price strong { display: block; font-size: 16px; font-weight: 750; }
.wish-price s { font-size: 12.5px; color: var(--muted); }

.wish-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wish-actions form { margin: 0; }

.link-danger { background: none; border: 0; padding: 0; font: inherit; font-size: 12.5px;
               color: var(--red); cursor: pointer; text-decoration: underline; }
.link-danger:hover { color: #b91c1c; }

/* ---------------- Credit panels ---------------- */

.credit-summary {
    background: var(--white); border: 1px solid var(--line);
    border-radius: var(--r-lg); padding: 22px; margin-bottom: 18px;
}
.credit-balance { text-align: center; margin-bottom: 16px; }
.credit-balance strong { display: block; font-size: 32px; font-weight: 800; letter-spacing: -.5px; }
.credit-balance small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.credit-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.credit-stat { text-align: center; }
.credit-stat strong { display: block; font-size: 22px; font-weight: 700; }
.credit-stat span { display: block; font-size: 12.5px; color: var(--muted); }

.credit-warning {
    background: #fffbeb; border: 1px solid #fde68a; color: #b45309;
    border-radius: var(--r-sm); padding: 12px 14px; font-size: 13.5px; margin-top: 16px; text-align: center;
}

.credit-applied { margin-top: 12px; }
.credit-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    font-size: 13.5px; margin-bottom: 8px;
}
.credit-header strong { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.credit-total { color: var(--green); font-weight: 700; }
.credit-line {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    font-size: 13px; padding: 4px 0; color: var(--ink-2);
}
.credit-line .credit-amount { color: var(--green); font-weight: 600; }

.credit-payable dl, .credit-payable dt, .credit-payable dd { margin: 0; }
.payable-total { font-size: 21px !important; font-weight: 800; letter-spacing: -.5px; }
.credit-free { margin: 14px 0; }

.credit-controls { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.credit-controls .co-check, .credit-controls label { font-size: 13.5px; }
.credit-points input { width: 100px; }
.gift-card-form { margin-bottom: 18px; }

.acct-credit-table .is-credit { color: var(--green); font-weight: 600; }
.acct-credit-table .is-debit { color: var(--red); font-weight: 600; }

.rules { margin: 0; }
.rules div { display: flex; justify-content: space-between; gap: 12px;
            padding: 7px 0; font-size: 13.5px; border-bottom: 1px solid var(--line-2); }
.rules div:last-child { border-bottom: 0; }
.rules dt { color: var(--muted); }
.rules dd { margin: 0; font-weight: 600; }

.issued-code { margin-bottom: 12px; }
.issued-code code { display: block; margin-bottom: 4px; }

@media (max-width: 640px) {
    .wish-row { flex-wrap: wrap; }
    .wish-price { text-align: left; width: 100%; }
    .wish-actions { width: 100%; }
}

/* ---------------- Notification bell & dropdown ---------------- */

.haction.notification-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: var(--r);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--ink-2);
    transition: background .12s, color .12s;
}
.haction.notification-bell:hover {
    background: var(--line-2);
    color: var(--blue);
}
.haction.notification-bell:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 360px;
    max-height: 420px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: 0 12px 28px rgba(15,23,42,.15);
    overflow: hidden;
    z-index: 100;
}
.notif-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
}
.notif-dropdown-head strong { font-size: 14px; font-weight: 600; }
.notif-view-all {
    font-size: 12.5px;
    color: var(--blue);
    font-weight: 500;
}
.notif-view-all:hover { text-decoration: underline; }

.notif-dropdown-body {
    max-height: 340px;
    overflow-y: auto;
}
.notif-loading, .notif-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
}

.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line-2);
    cursor: pointer;
    transition: background .12s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--line-2); }
.notif-item.notif-unread { background: #f0f9ff; }
.notif-item.notif-read { opacity: .7; }

.notif-icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 12px;
}
.notif-icon-info    { background: #dbeafe; color: #1d4ed8; }
.notif-icon-success { background: #dcfce7; color: #15803d; }
.notif-icon-warning { background: #fef3c7; color: #b45309; }
.notif-icon-danger  { background: #fee2e2; color: #b91c1c; }

.notif-content { flex: 1; min-width: 0; }
.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 2px;
}
.notif-message {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.notif-time {
    font-size: 11px;
    color: var(--muted);
}
.notif-action {
    font-size: 12px;
    color: var(--blue);
    font-weight: 500;
    text-decoration: none;
}
.notif-action:hover { text-decoration: underline; }

.notif-mark-read {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: none;
    background: var(--line-2);
    color: var(--green);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .12s, color .12s;
}
.notif-mark-read:hover { background: var(--green); color: #fff; }

/* Full notification list page */
.notif-list-full { list-style: none; margin: 0; padding: 0; }
.notif-full-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 14px;
    align-items: start;
    padding: 16px;
    border-bottom: 1px solid var(--line-2);
    transition: background .12s;
}
.notif-full-item:hover { background: var(--line-2); }
.notif-full-item.notif-unread { background: #f0f9ff; }
.notif-full-item.notif-read { opacity: .7; }

.notif-full-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 16px;
    margin-top: 2px;
}
.notif-icon-info    { background: #dbeafe; color: #1d4ed8; }
.notif-icon-success { background: #dcfce7; color: #15803d; }
.notif-icon-warning { background: #fef3c7; color: #b45309; }
.notif-icon-danger  { background: #fee2e2; color: #b91c1c; }

.notif-full-content { min-width: 0; }
.notif-full-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.notif-full-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}
.notif-full-time {
    font-size: 11.5px;
    color: var(--muted);
    white-space: nowrap;
}
.notif-full-message {
    font-size: 13px;
    color: var(--ink-2);
    margin: 0 0 8px;
    line-height: 1.5;
}
.notif-full-action {
    font-size: 13px;
    color: var(--blue);
    font-weight: 500;
    text-decoration: none;
}
.notif-full-action:hover { text-decoration: underline; }

.notif-full-mark { margin-top: 4px; }
.notif-mark-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: var(--line-2);
    color: var(--green);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .12s, color .12s;
}
.notif-mark-btn:hover { background: var(--green); color: #fff; }
.notif-mark-btn:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 640px) {
    .notif-dropdown {
        width: calc(100vw - 32px);
        right: -8px;
    }
    .notif-full-item {
        grid-template-columns: 40px 1fr;
    }
    .notif-full-mark {
        grid-column: 2;
        justify-self: end;
    }
}
