/* ============================================================
   Account / ЛК — styles
   ============================================================ */

.lk-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.lk-page-wide {
  max-width: 1160px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  align-items: start;
}
@media(max-width: 760px) {
  .lk-page-wide { grid-template-columns: 1fr; }
}

/* ── Auth card ── */
.lk-auth-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 48px 40px;
  max-width: 440px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}
.lk-auth-logo { font-size: 2.4rem; text-align: center; margin-bottom: 16px; }
.lk-auth-title {
  font-size: 1.6rem;
  text-align: center;
  margin: 0 0 8px;
}
.lk-auth-sub  { text-align: center; color: #6b6560; font-size: 0.92rem; margin: 0 0 28px; }
.lk-auth-hint { font-size: 0.84rem; color: var(--rust); margin: 10px 0 0; min-height: 18px; }

/* ── Sidebar ── */
.lk-sidebar {
  position: sticky;
  top: 96px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}
.lk-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.lk-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--charcoal); color: var(--bone);
  font-size: 1.2rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.lk-user-name  { font-weight: 600; font-size: 0.95rem; }
.lk-user-email { font-size: 0.78rem; color: #a39a8d; margin-top: 2px; }

.lk-nav { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }
.lk-nav-link {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #3c3733;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.lk-nav-link:hover   { background: var(--bone-deep); }
.lk-nav-link.active  { background: var(--charcoal); color: var(--bone); font-weight: 600; }
.lk-nav-link-contact { color: var(--rust); margin-top: 8px; }
.lk-nav-link-contact:hover { background: rgba(168,52,31,0.07); }

.lk-btn-logout {
  width: 100%; padding: 9px;
  background: none; border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer;
  font-size: 0.88rem; color: #a39a8d;
  transition: border-color 0.2s, color 0.2s;
}
.lk-btn-logout:hover { border-color: var(--rust); color: var(--rust); }

/* ── Content ── */
.lk-content { min-width: 0; }
.lk-page-title {
  font-size: 1.6rem;
  margin: 0 0 28px;
}

/* ── Loyalty banner ── */
.lk-loyalty-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, var(--charcoal), #2a2522);
  color: var(--bone);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 28px;
}
.lk-pts-num {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--brass);
}
.lk-pts-label { font-size: 0.82rem; color: rgba(247,241,232,0.6); margin-top: 4px; }
.lk-loyalty-title { font-weight: 600; margin-bottom: 4px; }
.lk-loyalty-sub   { font-size: 0.82rem; color: rgba(247,241,232,0.6); }

/* ── Section ── */
.lk-section { margin-bottom: 32px; }
.lk-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.lk-section-head h2 { font-size: 1.15rem; margin: 0; }
.lk-link { font-size: 0.88rem; color: var(--rust); text-decoration: none; }
.lk-link:hover { text-decoration: underline; }
.lk-empty { color: #a39a8d; font-size: 0.92rem; }

/* ── Order row (dashboard) ── */
.lk-order-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.lk-order-id   { font-size: 0.85rem; font-weight: 600; }
.lk-order-date { font-size: 0.82rem; color: #a39a8d; }
.lk-order-total { font-weight: 700; margin-left: auto; }

/* ── Order card (orders page) ── */
.lk-order-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 16px;
  overflow: hidden;
}
.lk-order-card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: var(--bone-deep);
  flex-wrap: wrap;
}
.lk-order-items { padding: 0 18px 14px; }
.lk-order-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.lk-order-item:last-child { border-bottom: none; }
.lk-order-item-img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.lk-order-item-name { flex: 1; font-size: 0.9rem; }
.lk-order-item-qty  { font-size: 0.82rem; color: #a39a8d; white-space: nowrap; }
.lk-order-item-price { font-weight: 600; white-space: nowrap; }

/* ── Status badges ── */
.lk-order-status {
  font-size: 0.75rem; font-weight: 600; border-radius: 20px;
  padding: 3px 10px; white-space: nowrap;
}
.lk-status-pending          { background: rgba(184,149,74,0.15); color: #8a6d1e; }
.lk-status-confirmed        { background: rgba(107,122,94,0.15); color: var(--sage-deep); }
.lk-status-assembling       { background: rgba(168,52,31,0.1);   color: var(--rust-deep); }
.lk-status-ready_pickup     { background: rgba(46,74,40,0.15);   color: var(--forest); }
.lk-status-awaiting_courier { background: rgba(192,120,40,0.15); color: #7a5000; }
.lk-status-in_delivery      { background: rgba(53,87,204,0.1);   color: #3355aa; }
.lk-status-shipped          { background: rgba(46,74,40,0.12);   color: var(--forest); }
.lk-status-delivered        { background: rgba(107,122,94,0.2);  color: var(--sage-deep); }
.lk-status-cancelled        { background: rgba(168,52,31,0.1);   color: var(--danger); }

/* ── Buttons ── */
.lk-btn-primary {
  background: var(--charcoal); color: var(--bone);
  border: none; border-radius: 10px;
  padding: 11px 22px; font-size: 0.92rem; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
  text-decoration: none; display: inline-block;
}
.lk-btn-primary:hover { background: #2e2b28; }
.lk-btn-wide { width: 100%; text-align: center; }

.lk-btn-ghost {
  background: none; border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 18px;
  font-size: 0.88rem; cursor: pointer; color: #3c3733;
  transition: border-color 0.2s;
  margin-top: 8px; display: block; width: 100%; text-align: center;
}
.lk-btn-ghost:hover { border-color: var(--charcoal); }

.lk-consent-label {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 0.8125rem; color: #555; line-height: 1.5;
  margin: 12px 0; cursor: pointer; text-align: left;
}
.lk-consent-label span { display: inline; }
.lk-consent-label input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; accent-color: var(--rust); }
.lk-consent-label a { color: var(--rust); }

.lk-danger-card { border: 1px solid rgba(168,52,31,.25); }
.lk-danger-hint { font-size: 0.875rem; color: #666; line-height: 1.5; margin-bottom: 16px; }
.lk-btn-danger {
  background: transparent; border: 1px solid var(--rust);
  color: var(--rust); border-radius: 10px; padding: 9px 20px;
  font-size: 0.9rem; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.lk-btn-danger:hover { background: var(--rust); color: #fff; }

.lk-btn-repeat {
  background: none; border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 12px;
  font-size: 0.8rem; cursor: pointer; color: #3c3733;
  transition: border-color 0.2s, color 0.2s;
  margin-left: auto;
}
.lk-btn-repeat:hover { border-color: var(--rust); color: var(--rust); }

.lk-btn-danger-sm {
  background: none; border: 1px solid rgba(168,52,31,0.3);
  border-radius: 8px; padding: 5px 12px;
  font-size: 0.8rem; cursor: pointer; color: var(--danger);
  transition: background 0.2s;
}
.lk-btn-danger-sm:hover { background: rgba(168,52,31,0.08); }

/* ── Forms ── */
.lk-field-group  { margin-bottom: 16px; }
.lk-label        { display: block; font-size: 0.82rem; font-weight: 600; color: #6b6560; margin-bottom: 6px; }
.lk-input {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 0.92rem;
  background: var(--bone); color: var(--charcoal);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.lk-input:focus  { border-color: var(--charcoal); box-shadow: 0 0 0 3px rgba(30,27,25,0.07); }
.lk-input:disabled { opacity: 0.55; cursor: default; }
.lk-input-code   { font-size: 1.4rem; letter-spacing: 0.25em; text-align: center; }
.lk-textarea {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 0.92rem;
  background: var(--bone); color: var(--charcoal);
  outline: none; resize: vertical; min-height: 100px;
  transition: border-color 0.2s; box-sizing: border-box;
}
.lk-textarea:focus { border-color: var(--charcoal); box-shadow: 0 0 0 3px rgba(30,27,25,0.07); }

.lk-checkbox-wrap { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; cursor: pointer; margin-bottom: 16px; }
.lk-checkbox-wrap input { accent-color: var(--charcoal); width: 16px; height: 16px; }
.lk-form-actions  { margin-top: 8px; }
.lk-form-error    { font-size: 0.84rem; color: var(--danger); margin-top: 8px; min-height: 18px; }
.lk-form-msg      { font-size: 0.84rem; margin-top: 10px; min-height: 18px; }
.lk-form-msg.ok   { color: var(--sage-deep); }
.lk-form-msg.err  { color: var(--danger); }

.lk-form-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 28px 32px; margin-bottom: 20px;
}
.lk-form-card h2 { font-size: 1.15rem; margin: 0 0 20px; }

/* ── Address cards ── */
.lk-addr-card {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px; margin-bottom: 10px;
}
.lk-addr-body { flex: 1; }
.lk-addr-label { font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.lk-addr-text  { font-size: 0.85rem; color: #6b6560; margin-top: 3px; }
.lk-addr-actions { display: flex; gap: 8px; flex-shrink: 0; }
.lk-badge-default {
  background: rgba(107,122,94,0.15); color: var(--sage-deep);
  font-size: 0.72rem; font-weight: 600; border-radius: 20px; padding: 2px 8px;
}

.lk-add-addr-form {
  background: var(--bone-deep); border: 1px dashed var(--line);
  border-radius: 14px; padding: 24px; margin-top: 20px;
}
.lk-add-addr-form h3 { margin: 0 0 18px; font-size: 1.05rem; }

/* ── Contact form ── */
.lk-contact-card { max-width: 640px; }
.lk-contact-sub  { color: #6b6560; margin: 0 0 28px; font-size: 0.92rem; }

.lk-file-drop {
  border: 2px dashed var(--line); border-radius: 12px;
  padding: 24px; text-align: center;
  cursor: pointer; transition: border-color 0.2s, background 0.2s;
  color: #a39a8d; font-size: 0.88rem; position: relative;
  min-height: 80px; display: flex; align-items: center; justify-content: center;
}
.lk-file-drop:hover, .lk-file-drop.drag { border-color: var(--charcoal); background: var(--bone-deep); }
.lk-file-preview { position: relative; display: inline-block; }
.lk-file-preview img { max-height: 140px; border-radius: 8px; display: block; }
.lk-file-remove {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--charcoal); color: #fff;
  border: none; cursor: pointer; font-size: 0.7rem;
  display: flex; align-items: center; justify-content: center;
}

.lk-contact-success { text-align: center; padding: 40px 0; }
.lk-success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(107,122,94,0.15); color: var(--sage-deep);
  font-size: 1.8rem; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.lk-contact-success h2 { margin: 0 0 8px; }
.lk-contact-success p  { color: #6b6560; margin: 0; }

/* ── Password input with eye toggle ── */
.lk-input-wrap {
  position: relative;
}
.lk-input-wrap .lk-input {
  padding-right: 42px;
}
.lk-eye-btn {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  cursor: pointer; font-size: 1rem;
  color: #a39a8d; padding: 4px;
  line-height: 1;
}

/* ── Auth hint colours ── */
.lk-hint-err { color: var(--danger) !important; }

/* ── In-app notifications ── */
.lk-notif-card { border-radius: 10px; border: 1.5px solid var(--line); padding: 14px 16px; margin-bottom: 10px; background: #fff; }
.lk-notif-new  { border-color: var(--brass); background: #fffdf5; }
.lk-notif-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.lk-notif-title { font-weight: 600; font-size: .9375rem; color: var(--charcoal); }
.lk-notif-date  { font-size: .75rem; color: #aaa; white-space: nowrap; }
.lk-notif-body  { font-size: .875rem; color: #555; line-height: 1.5; }

/* ===== Message thread (account/messages.ejs) ===== */
.msg-thread-list { display: flex; flex-direction: column; gap: 28px; }
.msg-thread { display: flex; flex-direction: column; gap: 10px; }
.msg-bubble {
  max-width: 80%;
  padding: 14px 16px;
  border-radius: 14px;
  line-height: 1.55;
}
.msg-bubble--client {
  align-self: flex-end;
  background: var(--forest);
  color: var(--bone);
  border-bottom-right-radius: 4px;
}
.msg-bubble--seller {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.msg-bubble-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.75rem;
  opacity: 0.75;
}
.msg-bubble--client .msg-bubble-head { color: rgba(247,241,232,0.8); }
.msg-bubble-author { font-weight: 600; }
.msg-bubble-text { font-size: 0.9rem; white-space: pre-wrap; word-break: break-word; }
.msg-attachment { display: block; margin-top: 10px; }
.msg-attachment img { max-width: 200px; border-radius: 8px; }
.msg-pending {
  align-self: flex-start;
  font-size: 0.78rem;
  color: #a39a8d;
  padding: 4px 0 0 4px;
  font-style: italic;
}

/* ── Chat threads (account/messages) ── */
.chat-threads { display: flex; flex-direction: column; gap: 16px; }

.chat-thread {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.chat-thread-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  cursor: pointer;
  user-select: none;
  background: var(--bone-deep);
  transition: background 0.15s;
}
.chat-thread-header:hover { background: #e8dfd2; }
.chat-thread-num { font-weight: 600; font-size: 0.92rem; }
.chat-thread-date { font-size: 0.8rem; color: #a39a8d; margin-left: 4px; }
.chat-thread-badge {
  margin-left: 6px;
  background: var(--rust);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.chat-thread-arrow {
  margin-left: auto;
  color: #a39a8d;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.chat-thread-body { padding: 16px 20px 20px; }

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.chat-msg { max-width: 78%; }
.chat-msg--client {
  align-self: flex-end;
  background: var(--forest, #2E4A28);
  color: #fff;
  border-radius: 14px;
  border-bottom-right-radius: 4px;
  padding: 10px 14px;
}
.chat-msg--seller {
  align-self: flex-start;
  background: var(--bone-deep);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 10px 14px;
}
.chat-msg-meta {
  font-size: 0.72rem;
  margin-bottom: 4px;
  opacity: 0.7;
}
.chat-msg--client .chat-msg-meta { color: rgba(255,255,255,0.75); }
.chat-msg-body { font-size: 0.9rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.chat-msg-img { display: block; margin-top: 8px; }
.chat-msg-img img { max-width: 200px; border-radius: 8px; }

.chat-reply-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.chat-reply-input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  resize: none;
  background: var(--bone);
  outline: none;
  box-sizing: border-box;
}
.chat-reply-input:focus { border-color: var(--forest, #2E4A28); }
.chat-reply-btn {
  background: var(--charcoal);
  color: var(--bone);
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.chat-reply-btn:hover { background: var(--rust); }
.chat-reply-btn:disabled { opacity: 0.6; cursor: default; }
