/* Accounts: header menu, banners, report button, modal, forms, login and account pages (js/auth.js). */

.header-actions { display: flex; align-items: center; gap: 10px; }
.auth-slot { display: flex; align-items: center; gap: 8px; }
.auth-slot[hidden] { display: none; }
.auth-slot .btn.sm { padding: 9px 16px; white-space: nowrap; }
@media (max-width: 520px) { .auth-slot .auth-register { display: none; } }

.user-menu { position: relative; }
.user-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px 0 6px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
}
.user-btn:hover { background: var(--border); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-weight: 800; font-size: .9rem;
}
.user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn .caret { font-size: .7rem; color: var(--muted); }
@media (max-width: 520px) { .user-name { display: none; } .user-btn { padding-right: 10px; } }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; z-index: 30;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column;
}
.user-pop[hidden] { display: none; }
.user-pop .user-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.user-pop .user-head span { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.user-pop a, .user-pop button {
  background: none; border: 0; text-align: left; font: inherit; font-size: .93rem; font-weight: 600;
  color: var(--text); padding: 10px 12px; border-radius: 9px; cursor: pointer; text-decoration: none;
}
.user-pop a:hover, .user-pop button:hover { background: var(--surface-2); text-decoration: none; }

.site-banner { background: var(--primary-soft); border-bottom: 1px solid var(--border); font-size: .92rem; }
.site-banner.warn { background: #fef3c7; color: #78350f; border-color: #fde68a; }
:root[data-theme="dark"] .site-banner.warn { background: #3a2c0a; color: #fcd34d; border-color: #5b4513; }
.site-banner .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 9px; padding-bottom: 9px; }
.site-banner button { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: inherit; opacity: .7; }
.site-banner button:hover { opacity: 1; }

.report-btn {
  display: none; margin-top: 10px; background: none; border: 0; padding: 4px 0; cursor: pointer;
  font: inherit; font-size: .82rem; font-weight: 600; color: var(--muted);
}
html.auth-on .report-btn { display: inline-flex; }
.report-btn:hover { color: var(--wrong); text-decoration: underline; }
.review-item .report-btn { margin-top: 6px; }

dialog.modal {
  border: 1px solid var(--border); border-radius: 18px; padding: 24px; width: min(460px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(8, 15, 28, .55); }
dialog.modal h3 { margin: 0 0 10px; font-size: 1.2rem; }
dialog.modal p { margin: 0 0 12px; color: var(--muted); }
dialog.modal .modal-q { color: var(--text); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: .92rem; max-height: 120px; overflow: auto; }
dialog.modal label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0; }
dialog.modal select, dialog.modal textarea { margin-top: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* form fields (login, account, admin) */
.field { display: block; margin: 0 0 16px; font-weight: 600; font-size: .9rem; }
.field > span { display: block; margin-bottom: 6px; }
.field input, .field select, .field textarea, dialog.modal select, dialog.modal textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  color: var(--text); font: inherit; font-weight: 500; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus, dialog.modal select:focus, dialog.modal textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
.field small { display: block; margin-top: 5px; font-weight: 500; color: var(--muted); font-size: .8rem; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 70px; }
.pw-wrap button {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer;
  color: var(--primary); font: inherit; font-weight: 700; font-size: .82rem; padding: 6px 8px;
}
.form-msg { min-height: 1.3em; margin: 0 0 8px; font-size: .9rem; font-weight: 600; color: var(--wrong); }
.form-msg.ok { color: var(--correct); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* login / register page */
.auth-page { min-height: calc(100vh - 64px - 70px); display: grid; place-items: center; padding: 32px 0 48px; }
.auth-card {
  width: min(440px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  box-shadow: var(--shadow-lg); padding: 30px;
}
.auth-card h1 { margin: 0 0 4px; font-size: 1.55rem; letter-spacing: -.02em; }
.auth-card .lead { margin: 0 0 20px; color: var(--muted); font-size: .95rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-bottom: 22px; }
.auth-tabs button { border: 0; background: none; padding: 10px; border-radius: 9px; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.auth-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(15, 27, 45, .12); }
.auth-card .btn.block { width: 100%; padding: 13px; }
.auth-foot { margin: 16px 0 0; font-size: .86rem; color: var(--muted); text-align: center; }
.perks { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; color: var(--muted); font-size: .88rem; }

/* account page */
.account-wrap { max-width: 760px; padding-bottom: 56px; }
.account-wrap h1 { margin: 28px 0 4px; letter-spacing: -.02em; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; margin-top: 18px; box-shadow: var(--shadow); }
.panel h2 { margin: 0 0 14px; font-size: 1.1rem; }
.panel .row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.panel .row .field { flex: 1 1 220px; margin-bottom: 0; }
.panel.danger { border-color: color-mix(in srgb, var(--wrong) 40%, var(--border)); }
.panel.danger h2 { color: var(--wrong); }
.btn.danger { background: var(--wrong); border-color: transparent; box-shadow: none; }
.acct-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 14px; }
.acct-stats div { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; color: var(--muted); font-size: .85rem; }
.acct-stats b { display: block; font-size: 1.45rem; color: var(--text); }
.tbl-wrap { overflow-x: auto; }
table.plain { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.plain th, table.plain td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.plain td.wrap { white-space: normal; min-width: 180px; }
table.plain th { color: var(--muted); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }

/* forgot password, link-style buttons, hidden panels inside the sign-in card */
.auth-card [hidden] { display: none !important; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--primary); cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: var(--primary-hover); }
