/* crunchy antibot — account, dashboard, admin and support pages */

.account-main {
  min-height: 60vh;
  padding: 42px 0 64px;
}

.account-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
  align-items: stretch;
}

.account-aside {
  display: flex;
  flex-direction: column;
  padding: 30px;
  color: #f8eee3;
  background: #2c2018;
  border-radius: 18px;
}

.account-aside .eyebrow {
  color: #d6bca6;
}

.account-aside h1 {
  margin: 10px 0 12px;
  color: #fff8ef;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.account-aside p {
  margin: 0 0 16px;
  color: #d9c7b7;
  font-size: 13px;
  line-height: 1.65;
}

.account-aside ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.account-aside li {
  position: relative;
  padding-left: 18px;
  color: #e5d5c7;
  font-size: 12px;
  line-height: 1.5;
}

.account-aside li::before {
  position: absolute;
  left: 0;
  top: 0;
  color: #f0a43c;
  content: "✓";
  font-weight: 800;
}

.account-card {
  min-width: 0;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 22px 50px -44px rgba(53, 31, 15, 0.5);
}

.account-card h2 {
  margin: 0 0 5px;
  font-size: 23px;
  letter-spacing: -0.03em;
}

.account-card .account-sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.account-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.account-field em {
  color: var(--faint);
  font-style: normal;
  font-weight: 400;
}

.account-field input,
.account-field select,
.account-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fffdfa;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.account-field textarea {
  min-height: 108px;
  resize: vertical;
}

.account-field input:focus,
.account-field select:focus,
.account-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 86, 63, 0.11);
}

.account-form .btn {
  width: 100%;
  justify-content: center;
  min-height: 43px;
}

.account-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 11.5px;
}

.account-links a {
  color: var(--accent-dark);
  font-weight: 600;
  text-decoration: none;
}

.account-links a:hover {
  text-decoration: underline;
}

.form-status {
  min-height: 18px;
  margin: 0;
  color: #8c5a48;
  font-size: 11.5px;
  line-height: 1.45;
}

.form-status.is-error {
  color: #b24a3f;
}

.form-status.is-success {
  color: var(--green);
}

.form-status:empty {
  display: none;
}

/* dashboard */

.dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dash-head h1 {
  margin: 4px 0 0;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.04em;
}

.dash-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.dash-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
  align-items: start;
}

.dash-card {
  min-width: 0;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.dash-card h2 {
  margin: 0 0 4px;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.dash-card .dash-sub {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 11.5px;
}

.key-display {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 11px;
  background: #fbf7f0;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
}

.key-display code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font: 600 12px/1.4 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-display .copy-btn {
  flex: none;
}

.meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.meta-list div {
  min-width: 0;
}

.meta-list dt {
  margin: 0 0 3px;
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta-list dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 8px;
}

.usage-line strong {
  font: 700 30px/1 var(--sans);
  letter-spacing: -0.04em;
}

.usage-line span {
  color: var(--muted);
  font-size: 11px;
}

.usage-bar {
  height: 8px;
  overflow: hidden;
  background: #eee3d5;
  border-radius: 99px;
}

.usage-bar > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #f0a43c, #e8563f);
  border-radius: inherit;
  transition: width 0.35s ease;
}

.usage-bar.is-high > span {
  background: #b24a3f;
}

.usage-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10.5px;
}

.request-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.request-form h3 {
  margin: 0;
  font-size: 13px;
}

.request-form .account-field textarea {
  min-height: 78px;
}

.request-note {
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.request-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.request-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  background: #fbf7f0;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
}

.request-item span {
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  flex: none;
  padding: 3px 7px;
  color: #8c5a48;
  background: var(--soft);
  border-radius: 99px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.is-ok {
  color: var(--green);
  background: #e9f5ee;
}

.badge.is-off {
  color: #b24a3f;
  background: #fbe9e5;
}

/* admin */

.admin-login {
  max-width: 430px;
  margin: 20px auto;
}

.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-head h1 {
  margin: 4px 0 0;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.04em;
}

.admin-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}

.stat-card {
  min-width: 0;
  padding: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.stat-card span {
  display: block;
  overflow: hidden;
  color: var(--faint);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.stat-card strong {
  display: block;
  margin-top: 5px;
  font: 700 22px/1 var(--sans);
  letter-spacing: -0.04em;
}

.admin-card {
  min-width: 0;
  padding: 18px;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.admin-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-card-head h2 {
  margin: 0;
  font-size: 15px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.admin-table th,
.admin-table td {
  padding: 8px 9px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.admin-table th {
  color: var(--faint);
  background: #fbf7f0;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table td {
  color: var(--muted);
}

.admin-table td strong {
  color: var(--ink);
  font-weight: 600;
}

.admin-table code {
  font: 500 10px/1.4 var(--mono);
  overflow-wrap: anywhere;
}

.admin-table .table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 170px;
}

.table-actions input {
  width: 76px;
  min-height: 28px;
  padding: 4px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 10px;
}

.mini-action {
  min-height: 28px;
  padding: 4px 8px;
  color: var(--ink);
  background: #fbf7f0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font: 600 10px/1.2 var(--sans);
  cursor: pointer;
}

.mini-action:hover {
  border-color: var(--accent);
}

.mini-action.is-danger {
  color: #b24a3f;
}

.mini-action:disabled {
  opacity: 0.45;
  cursor: default;
}

.admin-log {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 440px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.log-row {
  display: grid;
  grid-template-columns: 108px 120px minmax(0, 1fr) 120px;
  gap: 8px;
  padding: 7px 9px;
  border-bottom: 1px solid #f1e9de;
  font-size: 10px;
}

.log-row:last-child {
  border-bottom: 0;
}

.log-row time {
  color: var(--faint);
  white-space: nowrap;
}

.log-row .log-type {
  color: var(--accent-dark);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.log-row .log-who {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.log-row .log-ip {
  color: var(--faint);
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 18px 12px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

/* support */

.support-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 14px;
  align-items: start;
}

.support-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.support-card h1,
.support-card h2 {
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}

.support-card h1 {
  font-size: clamp(28px, 4vw, 38px);
}

.support-card h2 {
  font-size: 17px;
}

.support-card > p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.support-steps {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
  counter-reset: support-step;
}

.support-steps li {
  position: relative;
  padding-left: 31px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  counter-increment: support-step;
}

.support-steps li::before {
  position: absolute;
  left: 0;
  top: 0;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  content: counter(support-step);
  font: 700 10px/1 var(--sans);
}

.support-admin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 13px;
  background: #fbf7f0;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.support-admin span {
  color: var(--muted);
  font-size: 11px;
}

.support-admin a {
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 900px) {
  .account-shell,
  .dash-grid,
  .support-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 640px) {
  .account-main {
    padding: 26px 0 44px;
  }

  .account-aside,
  .account-card,
  .dash-card,
  .support-card {
    padding: 19px;
  }

  .dash-head,
  .admin-head {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .log-row {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .log-row .log-who,
  .log-row .log-ip {
    grid-column: 2;
  }

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

  .support-admin {
    flex-direction: column;
    align-items: flex-start;
  }
}
