/* Cartas Arena — Tela de Entrada Beta (Convite + Login + Cadastro com Termos) */
html[data-auth-gate="1"] .app-shell,
html[data-auth-gate="1"] .mobile-tabs,
html[data-auth-gate="1"] .menu-scrim {
  display: none !important;
}

html[data-auth-gate="1"] body {
  overflow-y: auto;
  background: #080917;
}

.ag-root {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(16px, 3vw, 28px) 16px;
  overflow-y: auto;
  color: #eef0fa;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(680px 440px at 50% 10%, rgba(240, 184, 92, 0.14), transparent 72%),
    radial-gradient(880px 540px at 85% 92%, rgba(112, 86, 214, 0.16), transparent 74%),
    radial-gradient(600px 420px at 12% 85%, rgba(56, 189, 248, 0.08), transparent 70%),
    linear-gradient(180deg, #121433 0%, #080917 62%, #060712 100%);
}

.ag-root[hidden] {
  display: none !important;
}

.ag-card {
  width: min(100%, 460px);
  margin: auto 0;
  flex: none;
  padding: clamp(22px, 3.5vw, 30px) clamp(20px, 4vw, 28px) 22px;
  border-radius: 20px;
  background: rgba(15, 18, 40, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(240, 184, 92, 0.24);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: width 0.22s ease;
}

.ag-card.is-wide {
  width: min(100%, 560px);
}

.ag-head {
  text-align: center;
  margin-bottom: 22px;
}

.ag-crest {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(240, 184, 92, 0.16), rgba(240, 184, 92, 0.06));
  border: 1px solid rgba(240, 184, 92, 0.34);
  color: #f0b85c;
  box-shadow: 0 10px 28px rgba(240, 184, 92, 0.12);
}

.ag-crest svg {
  width: 30px;
  height: 30px;
  display: block;
}

.ag-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #e4b860;
  margin-bottom: 6px;
}

.ag-head h1 {
  margin: 0 0 8px;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(24px, 4.5vw, 29px);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff7e6;
}

.ag-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #b4bad6;
}

.ag-msg {
  margin: 0 0 14px;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 13.5px;
  line-height: 1.45;
  border: 1px solid transparent;
}

.ag-msg[hidden] {
  display: none !important;
}

.ag-msg.is-error {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(248, 113, 113, 0.38);
  color: #fecaca;
}

.ag-msg.is-good {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(74, 222, 128, 0.38);
  color: #bbf7d0;
}

.ag-msg.is-info {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(147, 197, 253, 0.35);
  color: #dbeafe;
}

.ag-form {
  display: grid;
  gap: 13px;
}

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

@media (max-width: 540px) {
  .ag-row-2 {
    grid-template-columns: 1fr;
  }
}

.ag-field {
  display: grid;
  gap: 6px;
  text-align: left;
}

.ag-field > span {
  font-size: 12.5px;
  font-weight: 600;
  color: #d5daef;
  letter-spacing: 0.02em;
}

.ag-field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 11px;
  background: rgba(7, 9, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  font: 500 14.5px/1.2 "Plus Jakarta Sans", system-ui, sans-serif;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ag-field input::placeholder {
  color: #7c83a6;
}

.ag-field input:focus {
  border-color: rgba(240, 184, 92, 0.72);
  box-shadow: 0 0 0 3px rgba(240, 184, 92, 0.16);
}

.ag-hint {
  font-size: 11.5px;
  line-height: 1.4;
  color: #8f96b8;
}

.ag-btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font: 700 14.5px/1.2 "Plus Jakarta Sans", system-ui, sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, filter 0.15s ease, background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.ag-btn:active:not(:disabled) {
  transform: translateY(1px);
}

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

.ag-btn-primary {
  background: linear-gradient(135deg, #f3c46b 0%, #d89a38 100%);
  color: #161108;
  box-shadow: 0 10px 26px rgba(240, 184, 92, 0.24);
}

.ag-btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.ag-btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
  color: #eef0fa;
}

.ag-btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(240, 184, 92, 0.42);
}

.ag-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: #7d85a8;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ag-divider::before,
.ag-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.11);
}

.ag-invite-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.13), rgba(240, 184, 92, 0.11));
  border: 1px solid rgba(74, 222, 128, 0.34);
  font-size: 13px;
  line-height: 1.4;
}

.ag-invite-pill b {
  color: #dcfce7;
}

.ag-invite-pill small {
  display: block;
  color: #b7c2df;
  font-size: 12px;
}

.ag-link-btn {
  background: none;
  border: none;
  padding: 4px 6px;
  color: #f0c26b;
  font: 600 12.5px/1.2 "Plus Jakarta Sans", system-ui, sans-serif;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ag-link-btn:hover {
  color: #ffe09c;
}

/* Caixa scrollável de Termos na criação de conta */
.ag-terms-wrap {
  margin-top: 4px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 9, 22, 0.78);
  overflow: hidden;
}

.ag-terms-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 12px;
}

.ag-terms-bar strong {
  color: #f4d28b;
  font-weight: 700;
}

.ag-terms-status {
  font-size: 11.5px;
  color: #9ba3c4;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.ag-terms-status.is-read {
  color: #86efac;
  background: rgba(34, 197, 94, 0.16);
}

.ag-terms-scroll {
  max-height: 210px;
  overflow-y: auto;
  padding: 13px 14px;
  font-size: 12.5px;
  line-height: 1.58;
  color: #c8cee6;
  scrollbar-width: thin;
  scrollbar-color: rgba(240, 184, 92, 0.45) rgba(255, 255, 255, 0.04);
}

.ag-terms-scroll::-webkit-scrollbar {
  width: 7px;
}

.ag-terms-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

.ag-terms-scroll::-webkit-scrollbar-thumb {
  background: rgba(240, 184, 92, 0.42);
  border-radius: 999px;
}

.ag-terms-scroll h3 {
  margin: 14px 0 6px;
  font-size: 13.5px;
  color: #fff2d4;
}

.ag-terms-scroll h3:first-child {
  margin-top: 0;
}

.ag-terms-scroll p {
  margin: 0 0 8px;
}

.ag-terms-scroll ul {
  margin: 0 0 9px;
  padding-left: 18px;
}

.ag-terms-scroll li {
  margin-bottom: 4px;
}

.ag-terms-scroll table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 10px;
  font-size: 11.5px;
}

.ag-terms-scroll th,
.ag-terms-scroll td {
  text-align: left;
  padding: 6px 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  vertical-align: top;
}

.ag-terms-scroll th {
  background: rgba(240, 184, 92, 0.1);
  color: #f6d591;
}

.ag-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(240, 184, 92, 0.07);
  border: 1px solid rgba(240, 184, 92, 0.24);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.45;
  color: #e6eaf8;
  user-select: none;
}

.ag-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #f0b85c;
  flex: none;
  cursor: pointer;
}

.ag-foot {
  margin-top: 16px;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  font-size: 12.5px;
  color: #939bc0;
}

/* Modal de leitura completa dos Termos */
.ag-terms-modal {
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 5, 14, 0.78);
  backdrop-filter: blur(8px);
}

.ag-terms-modal[hidden] {
  display: none !important;
}

.ag-terms-dialog {
  width: min(100%, 760px);
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: #10132b;
  border: 1px solid rgba(240, 184, 92, 0.3);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.ag-terms-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ag-terms-dialog-head h2 {
  margin: 0;
  font-size: 16px;
  color: #fff4d8;
}

.ag-terms-dialog-body {
  padding: 18px 20px;
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.65;
  color: #d2d7ee;
}

.ag-terms-dialog-body h3 {
  margin: 18px 0 8px;
  font-size: 15px;
  color: #f6d38b;
}

.ag-terms-dialog-body h3:first-child {
  margin-top: 0;
}

.ag-terms-dialog-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
  font-size: 12.5px;
}

.ag-terms-dialog-body th,
.ag-terms-dialog-body td {
  text-align: left;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  vertical-align: top;
}

.ag-terms-dialog-body th {
  background: rgba(240, 184, 92, 0.11);
  color: #f6d591;
}

/* Página interna #termos */
.terms-page-doc {
  display: grid;
  gap: 14px;
  line-height: 1.65;
}

.terms-page-doc h3 {
  margin: 16px 0 6px;
  color: var(--gold, #f0b85c);
  font-size: 1.05rem;
}

.terms-page-doc p {
  margin: 0 0 8px;
}

.terms-page-doc ul {
  margin: 0 0 10px;
  padding-left: 20px;
}

.terms-page-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.9rem;
}

.terms-page-doc th,
.terms-page-doc td {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
  vertical-align: top;
}

.terms-page-doc th {
  background: rgba(240, 184, 92, 0.1);
}
