:root {
  --bg: #07142a;
  --card: rgba(255, 255, 255, 0.05);
  --text: #eef3ff;
  --muted: #b6c2dc;
  --accent: #7fb3ff;
  --accent-strong: #5b95ec;
  --danger: #ff7f9b;
  --ok: #7de6b6;
  --border: rgba(255, 255, 255, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: block;
  background: radial-gradient(circle at 15% 0%, #0e2d58 0%, var(--bg) 60%);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  padding: 24px 16px;
}

.auth-shell {
  width: min(560px, 100%);
  margin: 0 auto;
}

.auth-card,
.dashboard-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 22px;
  backdrop-filter: blur(8px);
}

h1 {
  margin: 0 0 6px;
  font-size: 1.65rem;
}

.auth-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form button {
  margin-top: 4px;
}

.inline-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.field-note {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.field-error {
  margin: -6px 0 2px;
  min-height: 16px;
  font-size: 0.82rem;
  color: #ffdbe5;
}

input.input-error {
  border-color: rgba(255, 127, 155, 0.65);
  box-shadow: 0 0 0 1px rgba(255, 127, 155, 0.2);
}

.lookup-status {
  margin: 0 0 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.lookup-status.is-idle {
  border-color: rgba(127, 179, 255, 0.25);
  color: #d8e8ff;
  background: rgba(22, 45, 84, 0.35);
}

.lookup-status.is-loading {
  border-color: rgba(127, 179, 255, 0.35);
  color: #d8e8ff;
  background: rgba(22, 45, 84, 0.5);
}

.lookup-status.is-success {
  border-color: rgba(125, 230, 182, 0.35);
  color: #d8ffef;
  background: rgba(19, 66, 48, 0.35);
}

.lookup-status.is-fallback {
  border-color: rgba(255, 210, 120, 0.35);
  color: #ffeec7;
  background: rgba(96, 70, 12, 0.28);
}

.is-hidden {
  display: none;
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

label {
  display: block;
  margin-top: 6px;
  margin-bottom: 4px;
  font-size: 0.92rem;
  color: var(--muted);
}

input {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(6, 14, 32, 0.65);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.98rem;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(127, 179, 255, 0.22);
}

button {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  background: var(--accent);
  color: #021226;
}

button:hover {
  background: var(--accent-strong);
}

.btn-secondary {
  background: #1a3158;
  color: #cfe2ff;
}

.btn-secondary:hover {
  background: #244171;
}

.form-message {
  min-height: 24px;
  margin: 0 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.15);
}

.form-message.is-error {
  border-color: rgba(255, 127, 155, 0.35);
  color: #ffdbe5;
  background: rgba(86, 16, 32, 0.35);
}

.form-message.is-success {
  border-color: rgba(125, 230, 182, 0.35);
  color: #d8ffef;
  background: rgba(19, 66, 48, 0.35);
}

.form-message.is-info {
  border-color: rgba(127, 179, 255, 0.35);
  color: #d8e8ff;
  background: rgba(22, 45, 84, 0.35);
}

.verify-instruction {
  margin: 0 0 6px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.95rem;
  text-align: center;
  color: #d8e8ff;
  background: rgba(22, 45, 84, 0.45);
  border: 1px dashed rgba(127, 179, 255, 0.35);
}

.auth-links {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-links a {
  color: var(--accent);
  text-decoration: none;
}

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

.dashboard-card {
  width: min(800px, 100%);
  margin: 0 auto;
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.dashboard-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-grid.single-column {
  grid-template-columns: 1fr;
}

.dashboard-grid article {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  padding: 12px;
}

.dashboard-grid h2 {
  margin: 0 0 8px;
  font-size: 1.06rem;
}

.dashboard-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.dashboard-grid article.trial-highlight {
  border-color: rgba(255, 74, 74, 0.95);
  background: linear-gradient(145deg, rgba(120, 8, 8, 0.8), rgba(55, 0, 0, 0.75));
  box-shadow: 0 0 0 2px rgba(255, 74, 74, 0.45), 0 16px 28px rgba(80, 0, 0, 0.45);
}

.dashboard-grid article.trial-highlight h2 {
  color: #ffd9d9;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dashboard-grid article.trial-highlight p,
.dashboard-grid article.trial-highlight p strong {
  color: #ffe9e9;
  font-weight: 800;
}

.user-shell {
  width: min(980px, 100%);
}

.user-card {
  width: 100%;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 14px;
}

.tab-button {
  background: #17315a;
  color: #d8e8ff;
  border: 1px solid var(--border);
}

.tab-new-badge {
  margin-left: 0.45rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  border: 1px solid #3b82f655;
  background: #3b82f622;
  color: #60a5fa;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

.tab-button.is-active {
  background: var(--accent);
  color: #021226;
}

.tab-panel {
  display: none;
}

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

.details-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  padding: 12px;
}

.detail-card h2 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

.detail-card p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
}

@media (max-width: 680px) {
  .inline-field {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    flex-direction: column;
  }
}

.tab-empty-hint {
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
  padding: 24px 12px;
}

.download-header {
  margin-bottom: 10px;
}

.download-header h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

.download-header .auth-subtitle {
  margin-bottom: 12px;
}

.download-warning {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #f59e0b88;
  background: #f59e0b22;
  color: #ffd7a1;
  font-size: 0.95rem;
  line-height: 1.45;
  font-weight: 600;
}

.download-changelog-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.download-changelog-list li {
  margin: 3px 0;
}

.support-header {
  margin-bottom: 8px;
}

.support-form {
  margin-top: 8px;
}

.support-form input[readonly] {
  background: rgba(255, 255, 255, 0.08);
  color: #d7e4ff;
}

.support-form textarea,
.support-form select {
  width: 100%;
  border: 1px solid var(--border);
  background: rgba(6, 14, 32, 0.65);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.98rem;
}

.support-form textarea:focus,
.support-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(127, 179, 255, 0.22);
}

.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Transaction card ── */

.tx-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.15);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Header: plan title + badges */
.tx-card__header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.tx-card__plan {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 0;
  margin-right: auto;
}

/* Metadata grid */
.tx-card__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}

.tx-meta-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tx-meta-item__label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tx-meta-item__value {
  font-size: 0.92rem;
}

/* Action row */
.tx-card__actions {
  display: flex;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.tx-btn-doc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.tx-btn-doc:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
}

.tx-btn-doc:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tx-btn-doc svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

a.tx-btn-doc.app-download-link {
  text-decoration: none;
}

/* Badges */
.tx-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.tx-badge--success { background: #16a34a22; color: #4ade80; border: 1px solid #16a34a44; }
.tx-badge--pending { background: #eab30822; color: #facc15; border: 1px solid #eab30844; }
.tx-badge--failed  { background: #dc262622; color: #f87171; border: 1px solid #dc262644; }
.tx-badge--blocked { background: #dc262622; color: #f87171; border: 1px solid #dc262644; }
.tx-badge--expired { background: #78716c22; color: #a8a29e; border: 1px solid #78716c44; }
.tx-badge--limit   { background: #eab30822; color: #facc15; border: 1px solid #eab30844; }
.tx-badge--topup   { background: #3b82f622; color: #60a5fa; border: 1px solid #3b82f644; }

.tx-discount-code {
  background: #8b5cf622;
  color: #c4b5fd;
  border: 1px solid #8b5cf644;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-right: 4px;
}

@media (max-width: 680px) {
  .tx-card__meta {
    grid-template-columns: 1fr;
  }
  .tx-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .download-warning {
    font-size: 0.9rem;
  }
}

/* License CTA action box */
.license-cta {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  padding: 24px 28px;
  text-align: center;
}

.license-cta h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.license-cta p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.license-cta__btn {
  display: inline-block;
  padding: 11px 28px;
  border-radius: 10px;
  background: var(--accent);
  color: #021226;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.15s;
}

.license-cta__btn:hover {
  background: var(--accent-strong);
}

/* ── Top-up section in license tab ─────────────────── */

.topup-section {
  margin-top: 20px;
}

.topup-section__title {
  font-size: 1.05rem;
  margin: 0 0 12px;
  color: var(--text);
}

.topup-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.future-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.future-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 0.9fr 1.4fr;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  padding: 12px 16px;
}

.future-row__label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.future-row__value {
  font-size: 0.95rem;
}

.topup-row {
  display: grid;
  grid-template-columns: 0.8fr 0.8fr 0.8fr 1fr 1.3fr 1.2fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  padding: 12px 16px;
}

.topup-row__label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.topup-row__value {
  font-size: 0.95rem;
}

.topup-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.topup-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}

@media (max-width: 680px) {
  .future-row {
    grid-template-columns: 1fr;
  }

  .topup-row {
    grid-template-columns: 1fr;
  }
}
