/* Reusable UI components */
.card {
  width: calc(100% - 24px);
  margin: 14px auto;
  padding: 28px 22px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(7, 94, 217, 0.14), transparent 72%);
  pointer-events: none;
}

.icon {
  width: 82px;
  height: 82px;
  margin: 0 auto 18px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 30px;
  box-shadow: 0 18px 30px rgba(7, 94, 217, 0.22);
}

.title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 24px;
}

.alert {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
}

.input-group {
  background: rgba(243, 247, 255, 0.96);
  border: 1px solid rgba(7, 94, 217, 0.12);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.input-group i {
  color: var(--primary);
  margin-right: 10px;
}

.input-group input,
select {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  width: 100%;
  font-size: 14px;
}

select {
  padding: 14px 16px !important;
  margin-bottom: 15px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(7, 94, 217, 0.12);
  background: rgba(243, 247, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.auth-select {
  width: 100%;
}

.input-group input::placeholder {
  color: rgba(126, 106, 85, 0.85);
}

.input-error {
  border: 1px solid var(--danger);
}

.btn {
  width: 100%;
  padding: 15px 18px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
  margin-top: 10px;
  position: relative;
  box-shadow: 0 16px 28px rgba(7, 94, 217, 0.26);
}

.btn:hover {
  transform: translateY(-2px);
  filter: saturate(1.05);
  box-shadow: 0 20px 36px rgba(7, 94, 217, 0.32);
}

.btn.btn-loading {
  pointer-events: none;
  opacity: 0.75;
}

.btn.btn-loading span {
  visibility: hidden;
}

.btn.btn-loading::after {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-top-color: transparent;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: spin 0.65s linear infinite;
}

.header-btn,
.copy-btn-modern,
.method-arrow,
.panel-icon,
.feature-badge,
.feature-arrow,
.resource-tile i,
.action-btn i,
.game-btn i,
.history-btn i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.signup,
.login-link,
.trust {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

.signup a,
.login-link a {
  color: var(--primary);
  font-weight: 700;
}

.features {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
}

.feature {
  font-size: 11px;
  text-align: center;
  opacity: 0.9;
}

.feature i {
  display: block;
  font-size: 18px;
  margin-bottom: 5px;
  color: var(--primary);
}

.summary-grid {
  display: flex;
  gap: 10px;
  text-align: center;
}

.summary-box {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(247, 243, 255, 0.88);
}

.summary-box span {
  font-size: 11px;
  color: var(--muted);
}

.summary-box strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
}

.saved-user {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
}

.saved-user span {
  cursor: pointer;
  flex: 1;
}

.saved-user button {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
}

.section-heading {
  margin-bottom: 12px;
}

.section-heading span,
.history-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  margin-bottom: 4px;
}

.section-heading h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.04em;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  min-width: 84px;
}

.badge.success {
  background: rgba(21, 128, 61, 0.12);
  color: var(--success);
}

.badge.pending,
.badge.level {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
}

.badge.cancel {
  background: rgba(194, 65, 12, 0.12);
  color: var(--danger);
}

.status-card {
  text-align: center;
  padding: 30px 20px;
}

.status-card h2 {
  margin-bottom: 8px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.status-card p {
  color: var(--muted);
  line-height: 1.6;
}

.status-action {
  margin-top: 20px !important;
}

@media (max-width: 480px) {
  .card {
    width: calc(100% - 12px);
    padding: 24px 18px;
    border-radius: 24px;
  }

  .title {
    font-size: 24px;
  }
}

/* Login reference redesign */
body.login-page {
  min-height: 100vh;
  padding: 34px;
  align-items: stretch;
  background:
    radial-gradient(ellipse at 20% 18%, rgba(255, 255, 255, 0.96), transparent 38%),
    radial-gradient(ellipse at 82% 16%, rgba(237, 242, 249, 0.9), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, #eef3f9 82%, #052b7f 82%, #031846 100%);
  overflow: hidden;
}

body.login-page::before {
  display: block;
  width: 1120px;
  height: 360px;
  left: -110px;
  right: auto;
  top: auto;
  bottom: 76px;
  border-radius: 0 0 50% 50%;
  filter: none;
  background: #ffffff;
  transform: rotate(7deg);
  box-shadow: 0 16px 0 #d69a22;
  z-index: 0;
}

body.login-page::after {
  display: block;
  width: 980px;
  height: 980px;
  top: -190px;
  left: -180px;
  right: auto;
  bottom: auto;
  border: 34px solid rgba(11, 27, 82, 0.035);
  border-radius: 50%;
  filter: none;
  background: transparent;
  z-index: 0;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(1160px, 100%);
  min-height: calc(100vh - 112px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(380px, 520px);
  align-items: center;
  gap: clamp(34px, 6vw, 86px);
}

.login-brand-panel {
  text-align: center;
  color: #0b326b;
}

.login-brand-mark {
  width: min(430px, 78vw);
  margin: 0 auto 18px;
}

.login-emblem {
  position: relative;
  width: min(330px, 70vw);
  aspect-ratio: 1.15;
  margin: 0 auto;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 20px 28px rgba(3, 24, 70, 0.12));
}

.login-emblem::before,
.login-emblem::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.login-emblem::before {
  width: 92%;
  height: 44%;
  left: 4%;
  bottom: 8%;
  border-bottom: 18px solid #063575;
  transform: rotate(-11deg);
}

.login-emblem::after {
  width: 48px;
  height: 48px;
  right: 18%;
  top: 20%;
  background: radial-gradient(circle, #d69a22 0 24%, transparent 25%);
  box-shadow:
    0 -24px 0 -18px #d69a22,
    0 24px 0 -18px #d69a22,
    24px 0 0 -18px #d69a22,
    -24px 0 0 -18px #d69a22;
}

.login-emblem > i {
  position: absolute;
  inset: 3% 16% 18% 8%;
  color: transparent;
  -webkit-text-stroke: 15px #d69a22;
  font-size: clamp(170px, 22vw, 270px);
  line-height: 1;
  transform: rotate(-6deg);
}

.login-emblem strong {
  position: relative;
  z-index: 1;
  color: #063575;
  font-size: clamp(62px, 8vw, 108px);
  font-weight: 900;
  letter-spacing: -0.08em;
  font-style: italic;
}

.login-emblem strong::after {
  content: "";
  position: absolute;
  left: 48%;
  right: -22%;
  bottom: 28%;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d69a22, #f2c35f);
}

.login-brand-panel h1 {
  margin: 0;
  color: #082b5f;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.login-brand-panel h1 span {
  display: block;
  margin-top: 8px;
  color: #d69a22;
  font-size: 0.52em;
  letter-spacing: 0.42em;
}

.login-brand-panel p {
  margin-top: 24px;
  color: #0b326b;
  font-size: 20px;
  font-weight: 600;
}

.login-card-panel {
  width: 100%;
}

.login-card {
  width: 100%;
  margin: 0;
  padding: clamp(24px, 3vw, 34px) clamp(22px, 3vw, 38px);
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(207, 217, 238, 0.86);
  box-shadow: 0 28px 70px rgba(3, 24, 70, 0.16);
  backdrop-filter: blur(18px);
  text-align: left;
}

.login-card::before {
  display: none;
}

.login-card-heading {
  margin-bottom: 18px;
  text-align: center;
}

.login-card-heading h2 {
  margin: 0 0 10px;
  color: #063575;
  font-size: clamp(30px, 3vw, 38px);
  line-height: 1.1;
  font-weight: 800;
}

.login-card-heading p {
  margin: 0;
  color: #5e6677;
  font-size: 16px;
  line-height: 1.5;
}

.login-card .alert {
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff6f6;
  border: 1px solid #ffe0e0;
}

.login-card .alert:empty {
  display: none;
}

.auth-label {
  display: block;
  margin: 14px 0 7px;
  color: #063575;
  font-size: 14px;
  font-weight: 800;
}

.login-input-group,
.login-select-wrap {
  min-height: 52px;
  margin: 0;
  padding: 0 16px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #cfd9ee;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-input-group:focus-within,
.login-select-wrap:focus-within {
  border-color: #075ed9;
  box-shadow: 0 0 0 4px rgba(7, 94, 217, 0.08);
}

.login-input-group > i,
.login-select-wrap > i {
  color: #4f5665;
  font-size: 18px;
}

.login-input-group input,
.login-select-wrap select {
  height: 50px;
  padding: 0 !important;
  margin: 0;
  color: #0b1437;
  font-size: 15px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.login-select-wrap select {
  appearance: none;
  cursor: pointer;
}

.password-toggle {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #4f5665;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 38px;
}

.login-card-link {
  margin: 10px 0 20px;
  text-align: right;
}

.login-card-link a {
  color: #063575;
  font-size: 13px;
  font-weight: 800;
}

.login-submit-btn {
  min-height: 54px;
  margin-top: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #052b7f 0%, #031846 100%);
  box-shadow: 0 18px 32px rgba(3, 24, 70, 0.24);
  font-size: 17px;
}

.login-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin: 20px 0;
  color: #6b7280;
  font-size: 14px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  height: 1px;
  background: #d8e0ef;
}

.login-saved-action {
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid #063575;
  border-radius: 12px;
  color: #063575;
  background: #ffffff;
}

.login-saved-action select {
  color: #063575;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.login-saved-action i {
  color: #063575;
}

.login-card .signup {
  margin-top: 20px;
  text-align: center;
  color: #5e6677;
  font-size: 14px;
}

.login-card .signup a {
  color: #075ed9;
}

.signup-card {
  padding-top: clamp(22px, 2.6vw, 30px);
  padding-bottom: clamp(22px, 2.6vw, 30px);
}

.signup-card .login-card-heading {
  margin-bottom: 14px;
}

.signup-card .auth-label {
  margin-top: 10px;
}

.signup-card .login-submit-btn {
  margin-top: 20px;
}

.signup-trust-note {
  min-height: 46px;
  margin-top: 16px;
  border: 1px solid #dfe7f5;
  border-radius: 12px;
  background: #f8fbff;
  color: #063575;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
}

.signup-trust-note i {
  color: #075ed9;
}

.login-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 28px;
  z-index: 1;
  color: #ffffff;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}

@media (max-width: 920px) {
  body.login-page {
    padding: 20px 14px 82px;
    overflow-y: auto;
    background:
      linear-gradient(180deg, #f8fbff 0%, #eef3f9 72%, #052b7f 72%, #031846 100%);
  }

  body.login-page::before {
    width: 760px;
    height: 220px;
    left: -160px;
    bottom: 78px;
  }

  .login-shell {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .login-brand-mark {
    width: 220px;
    margin-bottom: 8px;
  }

  .login-emblem > i {
    -webkit-text-stroke-width: 11px;
  }

  .login-brand-panel h1 {
    font-size: 30px;
  }

  .login-brand-panel h1 span {
    letter-spacing: 0.32em;
  }

  .login-brand-panel p {
    margin-top: 12px;
    font-size: 14px;
  }

  .login-card {
    max-width: 520px;
    margin: 0 auto;
    padding: 26px 18px;
  }

  .signup-card {
    padding-top: 22px;
    padding-bottom: 22px;
  }

  .login-card-heading {
    margin-bottom: 18px;
  }

  .login-card-heading h2 {
    font-size: 27px;
  }

  .login-card-heading p {
    font-size: 14px;
  }

  .login-footer {
    bottom: 24px;
    padding: 0 14px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  body.login-page {
    padding-top: 14px;
  }

  .login-brand-mark {
    width: 170px;
  }

  .login-emblem::before {
    border-bottom-width: 12px;
  }

  .login-brand-panel h1 {
    font-size: 24px;
  }

  .login-brand-panel p {
    font-size: 12px;
  }

  .login-input-group,
  .login-select-wrap,
  .login-submit-btn {
    min-height: 54px;
  }

  .login-input-group input,
  .login-select-wrap select {
    height: 52px;
    font-size: 13px;
  }

  .login-saved-action {
    padding: 0 12px;
  }

  .login-saved-action select {
    font-size: 13px;
  }
}
