/* app-account — single column cabinet + login */

:root {
  --space-1: 0.35rem;
  --space-2: 0.55rem;
  --space-3: 0.85rem;
  --space-4: 1.25rem;
  --space-5: 1.75rem;
  --radius: 10px;
  --border: 1px solid #c8ccd4;
  --bg-page: #f0f2f7;
  --bg-card: #fff;
  --text: #1a1d26;
  --text-muted: #5c6370;
  --accent: #1e5a8a;
  --danger: #8a1e2e;
  --ok: #1b6b3a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg-page);
}

.app-shell {
  max-width: 42rem;
  margin: 0 auto;
  padding: calc(var(--space-4) + var(--space-3)) var(--space-3) var(--space-5);
}

.app-alerts {
  margin-top: 0;
  margin-bottom: var(--space-4);
}

.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: var(--border);
  background: var(--bg-card);
  margin-bottom: var(--space-3);
}

.alert--success {
  border-color: #8ec9a0;
  background: #eef8f1;
}

.alert--error {
  border-color: #e0a0a8;
  background: #fdf2f3;
}

.alert--info {
  border-color: #b8c9e0;
  background: #f4f7fc;
}

.card {
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%);
}

/* Block 1 — header */
.cabinet-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.cabinet-header__logo {
  flex-shrink: 0;
}

.cabinet-header__logo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
  border-radius: var(--radius);
  border: var(--border);
  background: #fff;
}

.cabinet-header__meta {
  flex: 1;
  min-width: 0;
}

.cabinet-header__title {
  margin: 0 0 var(--space-1);
  font-size: 1rem;
  font-weight: 600;
}

.cabinet-header__ids {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cabinet-header__ids-sep {
  padding: 0 0.25em;
  color: var(--text-muted);
  user-select: none;
}

.cabinet-header__ids code {
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  background: #eef0f4;
  border-radius: 4px;
}

.btn-exit {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.btn-exit:hover {
  color: var(--danger);
  border-color: #d0a0a8;
  background: #fff8f8;
}

/* Block 2 — current */
.cabinet-current__email-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
}

.cabinet-current__get-code-wrap {
  flex-shrink: 0;
}

.cabinet-current__email-row .cabinet-current__email {
  margin: 0;
}

.cabinet-current__email {
  margin: 0 0 var(--space-2);
  font-size: 1.15rem;
  font-weight: 600;
  word-break: break-all;
}

.cabinet-current__get-code {
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.cabinet-current__get-code:hover {
  filter: brightness(1.08);
}

.cabinet-current__comment {
  margin: 0 0 var(--space-3);
  color: var(--text-muted);
}

.btn-primary {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.wait-panel {
  display: none;
  margin-top: var(--space-4);
  padding: var(--space-3);
  border-radius: var(--radius);
  border: 1px dashed #9aa3b5;
  background: #fafbfe;
}

.wait-panel.is-active {
  display: block;
}

.wait-panel__status {
  margin: 0 0 var(--space-2);
  font-weight: 500;
}

.wait-panel__countdown {
  font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.wait-panel__admin {
  display: none;
  margin-top: var(--space-3);
  color: var(--danger);
  font-weight: 500;
}

.wait-panel__admin.is-visible {
  display: block;
}

.timeout-static {
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius);
  border: 1px solid #e0a0a8;
  background: #fdf2f3;
  color: var(--danger);
  font-weight: 500;
}

/* Block 3 — history */
.history-title {
  margin: 0 0 var(--space-2);
  font-size: 1rem;
  font-weight: 700;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--space-3);
  text-align: start;
}

.history-item {
  padding: 0.15rem 0;
  border: none;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: #8a9099;
  word-break: break-all;
}

.history-item:first-child {
  padding-top: 0;
}

.history-list > .history-item--more {
  padding: 0.15rem 0;
  margin: 0;
  border: none;
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: none;
  text-align: start;
  word-break: normal;
  list-style: none;
}

.history-item--more__dots {
  display: inline-block;
  white-space: nowrap;
  letter-spacing: 0;
  color: var(--text);
}

/* Never show links inside history list (only plain email; «получить код» lives in block 2). */
.cabinet-history .history-list a {
  display: none !important;
}

/* Login + cabinet: shared column wrapper (same top offset inside .app-shell) */
.app-page {
  margin-top: 0;
  margin-inline: auto;
  padding-top: 0;
}

.app-page--login {
  max-width: 31.5rem;
}

.app-page--cabinet {
  max-width: 42rem;
  width: 100%;
}

.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.login-header__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.login-header__logo {
  flex-shrink: 0;
}

.login-header__logo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
  border-radius: var(--radius);
  border: var(--border);
  background: #fff;
}

.login-form {
  margin: 0;
}

.login-form__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.login-form__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  font-size: 1rem;
  border: var(--border);
  border-radius: var(--radius);
}

.login-form__submit {
  flex: 0 0 auto;
  white-space: nowrap;
}

.app-footer-note {
  margin-top: var(--space-5);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}
