@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #0d0f12;
  --surface: #14171b;
  --surface-2: #1a1e24;
  --surface-3: #21262e;
  --border: #2c313a;
  --border-soft: #2c313a80;
  --text: #f2efe6;
  --text-muted: #9a968c;
  --accent: #f4c430;
  --accent-hover: #e0b32a;
  --accent-ink: #14120a;
  --coral: #ea5a37;
  --teal: #57ab9f;
  --error-bg: #2a1712;
  --error-border: #4a2318;
  --error-text: #ff9270;
  --success-bg: #12241c;
  --success-border: #1f4534;
  --success-text: #6fcf9e;

  --display: "Fraunces", serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

button {
  font-family: inherit;
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  /* Закреплён при скролле — тот же эффект, что в почте (там его даёт
     app-shell вёрстка на всю высоту экрана; здесь страница обычная,
     скроллится целиком, поэтому проще и надёжнее закрепить сам topbar). */
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
  white-space: nowrap;
}

main {
  flex: 1;
  padding: 24px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.state-box {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
}

.state-box.error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
}

.card h2 {
  margin: 0 0 18px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 16px;
  background: var(--surface-2);
  color: var(--text);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

input[type="text"]:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-actions button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
}

.form-actions button.primary:hover {
  background: var(--accent-hover);
}

.saved-hint {
  font-size: 13px;
  color: var(--success-text);
}

/* ---------- Подписка / тариф ---------- */

.tariff-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.tariff-card:hover {
  border-color: var(--accent);
}

.tariff-card.active {
  border-color: var(--accent);
  background: var(--surface-2);
}

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

.tariff-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
}

.tariff-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
}

.tariff-price {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.tariff-features {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tariff-note {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 12px 0 0;
}

/* ---------- Сетка сервисов prufit (тот же компонент, что в почте/диске) ---------- */

.icon-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 50%;
  line-height: 1;
}

.icon-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.dropdown-holder {
  position: relative;
}

.apps-panel,
.account-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 26px 60px -18px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 60;
}

.apps-panel {
  width: 280px;
  padding: 18px;
}

.apps-panel.show,
.account-panel.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.apps-panel-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 14px 6px;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.apps-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 6px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 12.5px;
  text-align: center;
}

.apps-tile:hover {
  background: var(--surface-3);
}

.apps-tile-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: var(--surface-3);
}

.apps-tile.active .apps-tile-icon {
  background: var(--accent);
}

/* ---------- Меню аккаунта (тот же компонент, что в почте/диске) ---------- */

.account-panel {
  width: 264px;
  padding: 20px;
}

.account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--coral));
  color: var(--accent-ink);
  border: none;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: box-shadow 0.2s ease;
}

.account-avatar:hover:not(:disabled) {
  box-shadow: 0 0 0 4px #f4c43026;
}

.account-avatar-lg {
  width: 46px;
  height: 46px;
  font-size: 19px;
  cursor: default;
}

.account-avatar-lg:hover {
  box-shadow: none;
}

.account-panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.account-panel-hi {
  font-family: var(--body);
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}

.account-email {
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
}

.account-panel-quota {
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 14px;
}

.account-panel-logout {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  padding: 10px 12px;
  cursor: pointer;
  border-radius: 8px;
}

.account-panel-logout:hover:not(:disabled) {
  border-color: var(--coral);
  color: var(--coral);
  background: transparent;
}

.account-panel-logout:disabled {
  opacity: 0.6;
}
