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

:root {
  --bg-deep: #0a1018;
  --bg-panel: #121a24;
  --bg-elevated: #182333;
  --line: #2a3a4f;
  --text: #e8eef7;
  --muted: #8fa3bb;
  --accent: #3b9eff;
  --accent-strong: #1f7ee8;
  --pro: #e8b84a;
  --pro-soft: rgba(232, 184, 74, 0.12);
  --success: #3dcf8e;
  --font-ui: "Figtree", "Segoe UI", sans-serif;
  --font-display: "Syne", "Figtree", sans-serif;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(59, 158, 255, 0.14), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(232, 184, 74, 0.08), transparent 50%),
    var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
}

.header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(42, 58, 79, 0.9);
  background: linear-gradient(180deg, rgba(18, 26, 36, 0.96), rgba(12, 18, 26, 0.92));
  backdrop-filter: blur(10px);
}

.header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 0.35rem 0 0;
  color: #8b9cb3;
  font-size: 0.9rem;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: calc(100vh - 80px);
}

.sidebar {
  border-right: 1px solid #1e2936;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: #121820;
}

.drop-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #8b9cb3;
}

.profile-select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #0f1419;
  color: #e7ecf3;
  font-size: 0.85rem;
}

.profile-hint {
  margin: 0;
  font-size: 0.72rem;
  color: #8b9cb3;
  line-height: 1.35;
}

.drop-pair {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.drop-zone {
  border: 2px dashed #334155;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

.drop-zone.has-file {
  border-color: #22c55e;
  border-style: solid;
}

.drop-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
}

.drop-hint {
  display: block;
  font-size: 0.75rem;
  color: #8b9cb3;
  margin-top: 0.25rem;
  word-break: break-all;
}

.btn {
  border: 1px solid #334155;
  background: #1a2332;
  color: #e7ecf3;
  border-radius: 6px;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover:not(:disabled) {
  background: #243044;
}

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

.btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  width: 100%;
  margin-top: 0.5rem;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

.btn-danger {
  border-color: #7f1d1d;
  color: #fca5a5;
}

.btn-danger:hover:not(:disabled) {
  background: #450a0a;
}

.btn.active {
  background: #1e3a5f;
  border-color: #3b82f6;
}

.btn-icon {
  background: none;
  border: none;
  color: #8b9cb3;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}

.btn-icon:hover {
  color: #ef4444;
}

.queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.queue-header h2 {
  margin: 0;
  font-size: 0.95rem;
}

.queue-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #1e2936;
  cursor: pointer;
  background: #0f1419;
}

.queue-item:hover {
  border-color: #334155;
}

.queue-item.selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.queue-names {
  display: block;
  font-size: 0.78rem;
  word-break: break-all;
}

.queue-meta {
  display: block;
  font-size: 0.72rem;
  color: #8b9cb3;
  margin-top: 0.15rem;
  text-transform: capitalize;
}

.main {
  padding: 1rem 1.25rem;
  overflow: auto;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: #8b9cb3;
  text-align: center;
}

.empty-state .hint {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.hidden {
  display: none !important;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.export-prefix-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 0.25rem;
  font-size: 0.75rem;
  color: #8b9cb3;
}

.export-prefix-field span {
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.export-prefix-field input {
  width: 9.5rem;
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #0f1419;
  color: #e8eef7;
  font-size: 0.82rem;
  font-family: inherit;
}

.export-prefix-field input:focus {
  outline: none;
  border-color: #5b8def;
  box-shadow: 0 0 0 2px rgba(91, 141, 239, 0.2);
}

.export-prefix-field input::placeholder {
  color: #5a6b80;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-badge.ready {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.status-badge.needs_review {
  background: rgba(251, 146, 60, 0.2);
  color: #fb923c;
}

.status-badge.detecting {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.card-count {
  margin-left: 0.5rem;
  font-size: 0.85rem;
  color: #8b9cb3;
}

.canvases {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.canvas-wrap h3 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  color: #8b9cb3;
}

canvas {
  display: block;
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid #1e2936;
  cursor: crosshair;
  background: #000;
}

.thumb-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #1e2936;
  min-height: 2.5rem;
}

.thumb-loading {
  font-size: 0.8rem;
  color: #8b9cb3;
  padding: 0.5rem 0;
}

.thumb-pair {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid #1e2936;
  border-radius: 6px;
  cursor: pointer;
  background: #121820;
}

.thumb-pair.selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.thumb-pair:hover {
  border-color: #3b82f6;
}

.thumb-view-btn {
  padding: 0.2rem 0.45rem;
  font-size: 0.68rem;
  line-height: 1.2;
  white-space: nowrap;
}

.thumb-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: #8b9cb3;
  min-width: 1.5rem;
  text-align: center;
}

.thumb-pair img {
  height: 72px;
  border-radius: 3px;
  border: 1px solid #334155;
}

.cut-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cut-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.cut-modal-panel {
  position: relative;
  width: min(980px, 96vw);
  max-height: 92vh;
  background: #121820;
  border: 1px solid #334155;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

.cut-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid #1e2936;
  flex-shrink: 0;
}

.cut-modal-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  flex: 1;
}

.cut-modal-nav {
  display: flex;
  gap: 0.4rem;
}

.cut-modal-close {
  min-width: 2.25rem;
}

.cut-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
  padding: 1.1rem;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.cut-modal-side {
  display: flex;
  flex-direction: column;
  min-width: 0; /* allow grid children to shrink — prevents clipping */
}

.cut-modal-side h3 {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b9cb3;
  text-align: center;
}

.cut-modal-img-wrap {
  flex: 1;
  min-height: 0;
  min-width: 0;
  background: #0a0e13;
  border: 1px solid #1e2936;
  border-radius: 8px;
  padding: 0.65rem;
  overflow: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: min(68vh, 720px);
}

.cut-modal-img-wrap img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(64vh, 680px);
  object-fit: contain;
  border-radius: 3px;
  cursor: zoom-in;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.cut-modal-img-wrap img.zoomed {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  cursor: zoom-out;
}

.cut-modal-hint {
  margin: 0;
  padding: 0.55rem 1.1rem 0.9rem;
  font-size: 0.72rem;
  color: #8b9cb3;
  text-align: center;
  border-top: 1px solid #1e2936;
  flex-shrink: 0;
}

.cut-modal.loading .cut-modal-body {
  opacity: 0.4;
  pointer-events: none;
}

@media (max-width: 640px) {
  .cut-modal-body {
    grid-template-columns: 1fr;
  }

  .cut-modal-img-wrap {
    max-height: 42vh;
  }

  .cut-modal-img-wrap img {
    max-height: 38vh;
  }
}

/* ---------------------------------------------------------------
   App footer
--------------------------------------------------------------- */
.app-footer {
  padding: 0.6rem 1.5rem;
  border-top: 1px solid #1e2936;
  background: #121820;
  font-size: 0.75rem;
  color: #8b9cb3;
  text-align: center;
}

.app-footer a {
  color: #8b9cb3;
  text-decoration: none;
}

.app-footer a:hover {
  color: #e7ecf3;
  text-decoration: underline;
}

/* ---------------------------------------------------------------
   Header inner layout
--------------------------------------------------------------- */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------
   Usage banner
--------------------------------------------------------------- */
.api-status {
  margin-top: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.api-status.warn {
  background: rgba(251, 146, 60, 0.15);
  border: 1px solid rgba(251, 146, 60, 0.4);
  color: #fdba74;
}

.api-status.ok {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.usage-banner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.4rem 0.55rem 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(90, 120, 160, 0.28);
  background: rgba(10, 16, 24, 0.45);
}

/* Account / Admin / How-to panels */
.panel-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.panel-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(6px);
}

.panel-modal-card {
  position: relative;
  width: min(480px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: linear-gradient(165deg, rgba(28, 40, 56, 0.98), rgba(12, 18, 26, 0.99));
  border: 1px solid rgba(90, 120, 160, 0.3);
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
}

.panel-modal-card.panel-wide {
  width: min(860px, 96vw);
}

.panel-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(90, 120, 160, 0.25);
}

.panel-modal-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.panel-modal-body {
  padding: 1.15rem;
}

.account-grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
}

.account-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(8, 12, 18, 0.55);
  border: 1px solid rgba(90, 120, 160, 0.22);
  font-size: 0.88rem;
}

.account-row span {
  color: var(--muted);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.account-actions .btn,
.account-actions .btn-primary {
  width: auto;
  margin: 0;
}

.account-note {
  margin: 0.9rem 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.admin-stat {
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(90, 120, 160, 0.25);
  background: rgba(8, 12, 18, 0.5);
}

.admin-stat strong {
  display: block;
  font-size: 1.25rem;
  font-family: var(--font-display);
  margin-bottom: 0.15rem;
}

.admin-stat span {
  font-size: 0.72rem;
  color: var(--muted);
}

.admin-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.admin-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.admin-toolbar select {
  padding: 0.4rem 0.55rem;
  border-radius: 7px;
  border: 1px solid #334155;
  background: #0f1419;
  color: #e7ecf3;
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid rgba(90, 120, 160, 0.25);
  border-radius: 10px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.admin-table th,
.admin-table td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid rgba(90, 120, 160, 0.18);
  white-space: nowrap;
}

.admin-table th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(8, 12, 18, 0.65);
}

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

.plan-pill {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.plan-pill.pro {
  background: rgba(232, 184, 74, 0.18);
  color: #f3d07a;
}

.plan-pill.free {
  background: rgba(59, 158, 255, 0.14);
  color: #9ecfff;
}

.howto-steps {
  margin: 0 0 1.25rem;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  color: #c5d4e6;
  line-height: 1.45;
}

.howto-callout {
  padding: 1rem 1.05rem;
  border-radius: 12px;
  border: 1px solid rgba(232, 184, 74, 0.35);
  background: linear-gradient(160deg, rgba(232, 184, 74, 0.12), rgba(18, 26, 36, 0.4));
}

.howto-callout h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-family: var(--font-display);
}

.howto-callout p {
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
  color: #d5e0ed;
  line-height: 1.45;
}

.howto-callout p:last-child {
  margin-bottom: 0;
}

.howto-callout a {
  color: #f3d07a;
}

.usage-text {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

.btn-upgrade {
  background: linear-gradient(180deg, #f0c25c, #d9a534);
  border-color: #c99628;
  color: #1a1408;
  font-weight: 700;
}

.btn-upgrade:hover:not(:disabled) {
  background: linear-gradient(180deg, #f6cd6f, #e0ad3d);
}

.btn-logout {
  color: #8b9cb3;
}

/* ---------------------------------------------------------------
   Batch mode toggle + export-all row
--------------------------------------------------------------- */
.export-all-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.batch-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: #8b9cb3;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.batch-toggle input[type="checkbox"] {
  accent-color: #3b82f6;
  cursor: pointer;
}

/* ---------------------------------------------------------------
   Ctrl-hint in empty state
--------------------------------------------------------------- */
.ctrl-hint {
  margin-top: 0.75rem;
}

kbd {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border: 1px solid #334155;
  border-radius: 4px;
  background: #1a2332;
  font-size: 0.78rem;
  font-family: inherit;
  color: #c7d2e7;
}

/* ---------------------------------------------------------------
   Auth modal
--------------------------------------------------------------- */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: auth-fade-in 0.35s ease;
}

@keyframes auth-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px 400px at 50% 20%, rgba(59, 158, 255, 0.18), transparent 60%),
    radial-gradient(700px 420px at 70% 80%, rgba(232, 184, 74, 0.1), transparent 55%),
    rgba(4, 8, 14, 0.88);
  backdrop-filter: blur(8px);
}

.auth-modal-shell {
  position: relative;
  width: min(520px, 96vw);
  animation: auth-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes auth-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-modal-panel {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(165deg, rgba(28, 40, 56, 0.96), rgba(14, 20, 30, 0.98) 55%, rgba(12, 18, 26, 0.99));
  border: 1px solid rgba(90, 120, 160, 0.28);
  border-radius: 18px;
  padding: 1.85rem 1.7rem 1.35rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.35);
}

.auth-modal-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #5ec4b8 45%, var(--pro));
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth-modal-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(180deg, #fff 20%, #b8d4f5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-modal-lede {
  margin: 0.55rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.4;
}

.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 1.35rem;
}

.plan-card {
  position: relative;
  border-radius: 12px;
  padding: 0.9rem 0.85rem 0.85rem;
  border: 1px solid var(--line);
  background: rgba(10, 16, 24, 0.55);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.plan-card:hover {
  transform: translateY(-2px);
}

.plan-free {
  border-color: rgba(90, 120, 160, 0.35);
}

.plan-pro {
  border-color: rgba(232, 184, 74, 0.45);
  background:
    linear-gradient(160deg, rgba(232, 184, 74, 0.16), rgba(18, 26, 36, 0.4) 55%),
    rgba(10, 16, 24, 0.65);
  box-shadow: 0 0 0 1px rgba(232, 184, 74, 0.08), 0 10px 28px rgba(0, 0, 0, 0.25);
}

.plan-badge {
  position: absolute;
  top: -0.45rem;
  right: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a1408;
  background: linear-gradient(180deg, #f0c25c, #d9a534);
}

.plan-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.55rem;
}

.plan-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.plan-price {
  color: var(--muted);
  font-size: 0.78rem;
}

.plan-price strong {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
}

.plan-pro .plan-price strong {
  color: #f3d07a;
}

.plan-perks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.plan-perks li {
  position: relative;
  padding-left: 1.05rem;
  font-size: 0.76rem;
  color: #b7c7d9;
  line-height: 1.35;
}

.plan-perks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.38rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(59, 158, 255, 0.18);
}

.plan-pro .plan-perks li::before {
  background: var(--pro);
  box-shadow: 0 0 0 2px var(--pro-soft);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  margin-bottom: 1.1rem;
  padding: 0.3rem;
  border: 1px solid rgba(90, 120, 160, 0.28);
  border-radius: 12px;
  background: rgba(8, 12, 18, 0.55);
}

.auth-tab {
  padding: 0.6rem 0.5rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.active {
  background: linear-gradient(180deg, #2b6fbf, var(--accent-strong));
  color: #fff;
  box-shadow: 0 6px 16px rgba(31, 126, 232, 0.35);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.auth-form label {
  margin-top: 0.2rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--muted);
}

.auth-form input {
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(90, 120, 160, 0.35);
  border-radius: 10px;
  background: rgba(8, 12, 18, 0.7);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-form input::placeholder {
  color: #6d8198;
}

.auth-form input:focus {
  border-color: var(--accent);
  background: rgba(10, 18, 28, 0.95);
  box-shadow: 0 0 0 3px rgba(59, 158, 255, 0.18);
}

.auth-error {
  padding: 0.6rem 0.75rem;
  border-radius: 9px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  font-size: 0.8rem;
}

.turnstile-wrap {
  margin-top: 0.65rem;
  display: flex;
  justify-content: center;
  min-height: 65px;
}

.auth-submit-btn {
  margin-top: 0.75rem;
  width: 100%;
  padding: 0.78rem 1rem;
  border: none;
  border-radius: 11px;
  background: linear-gradient(180deg, #49a6ff, var(--accent-strong));
  box-shadow: 0 10px 24px rgba(31, 126, 232, 0.35);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 700;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.auth-submit-btn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.auth-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.auth-support {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.auth-support-link {
  color: #c5d7ec;
  text-decoration: none;
  border-bottom: 1px solid rgba(197, 215, 236, 0.35);
}

.auth-support-link:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 520px) {
  .plan-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

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