/* ==========================================================================
   GoGoTeam Redeem - Styles
   Style: matches transfer.gogoteam.net (clean, minimal, black/white)
   ========================================================================== */

:root {
  --bg: #fafafa;
  --card: #ffffff;
  --text: #111111;
  --text2: #666666;
  --text3: #999999;
  --border: #eaeaea;
  --accent: #0070f3;
  --accent-light: #e8f4ff;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #dcfce7;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .08);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { font-size: 16px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* App */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Container */
.container {
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: 40px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 32px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -.3px;
  color: var(--text3);
}

.logo-text {
  font-weight: 700;
  color: var(--text);
}

.title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
}

.subtitle {
  font-size: 15px;
  color: var(--text2);
}

/* Steps Indicator */
.steps-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0.35;
  transition: opacity .2s;
}

.step.active { opacity: 1; }
.step.completed { opacity: 0.7; }

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #f0f0f0;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--text3);
  transition: all .2s;
}

.step.active .step-number {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
}

.step.completed .step-number {
  background: var(--success-bg);
  border-color: #86efac;
  color: var(--success);
  font-size: 0;
}

.step.completed .step-number::after {
  content: '\2713';
  font-size: 14px;
}

.step-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text3);
  white-space: nowrap;
}

.step.active .step-label { color: var(--accent); }

.step-line {
  flex: 0 0 32px;
  height: 1.5px;
  background: var(--border);
  margin: 0 6px 20px;
}

/* Main Content */
.main-content {
  width: 100%;
  position: relative;
}

.step-content {
  display: none;
  width: 100%;
}

.step-content.active {
  display: block;
  animation: fadeInUp .3s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
  transition: box-shadow .3s, transform .3s;
  transform: translateY(-1px);
}

.card:hover {
  box-shadow: 0 20px 55px rgba(0, 0, 0, .12);
  transform: translateY(-3px);
}

.card-header {
  text-align: center;
  margin-bottom: 8px;
}

.card h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--text);
}

.card-desc {
  font-size: 14px;
  color: var(--text2);
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fafafa;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

input[type="text"],
input[type="email"] {
  height: 48px;
}

textarea {
  padding: 12px 14px;
  resize: vertical;
  min-height: 110px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 13px;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder { color: #ccc; }

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
  background: #fff;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary {
  background: #111;
  color: #fff;
}

.btn-primary:hover {
  background: #333;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: #fff;
  color: var(--text2);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  border-color: #999;
  color: var(--text);
}

.btn-group {
  display: flex;
  gap: 10px;
}

.btn-group .btn { flex: 1; }

.btn .btn-loading { display: none; }
.btn.loading .btn-text { display: none; }
.btn.loading .btn-loading { display: inline; }

/* Credential Step */
.credential-step {
  background: #f8faff;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 20px;
}

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

.credential-step-item {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
}

.credential-step-item a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.credential-step-item a:hover {
  color: #0051b3;
}

/* Confirm Info */
.confirm-info {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
}

.confirm-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.confirm-item:last-child { border-bottom: none; }

.confirm-label {
  font-size: 13px;
  color: var(--text3);
}

.confirm-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* Notice Box */
.notice-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.notice-box.notice-warning {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.notice-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.notice-desc {
  font-size: 13px;
  color: var(--danger);
  line-height: 1.5;
}

/* Messages */
.message {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  display: none;
}

.message.message-success {
  display: block;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
}

.message.message-error {
  display: block;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}

/* Result */
.result-icon {
  font-size: 52px;
  margin-bottom: 16px;
}
.result-icon.success { color: var(--success); }
.result-icon.error { color: var(--danger); }

.result-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.5px;
  margin-bottom: 8px;
}

.result-product {
  font-size: 14px;
  color: var(--text2);
}

.result-message {
  font-size: 14px;
  color: var(--danger);
  margin-top: 8px;
}

/* Extra Links */
.extra-links {
  text-align: center;
  margin-top: 24px;
}

.extra-links a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

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

.link-divider {
  margin: 0 12px;
  color: var(--border);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal {
  background: var(--card);
  width: 90%;
  max-width: 600px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
}

.modal-header {
  padding: 16px 20px;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 15px;
}

.modal-close {
  cursor: pointer;
  font-size: 22px;
  color: var(--text3);
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 16px;
  max-height: 450px;
  overflow-y: auto;
}

/* History */
.history-header {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr 1fr;
  gap: 8px;
  padding: 10px 12px;
  background: #f5f5f5;
  border-radius: 8px 8px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
}

.history-header-item { text-align: center; }

.history-item {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr 1fr;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
  color: var(--text2);
}

.history-item:last-child { border-bottom: none; }
.history-value { text-align: center; word-break: break-all; }
.history-result { text-align: center; color: var(--success); font-weight: 500; }

.history-empty {
  display: block;
  text-align: center;
  padding: 30px;
  color: var(--text3);
}

/* Query Page */
.query-nav {
  margin-bottom: 24px;
}

.query-nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.query-nav a:hover { text-decoration: underline; }

.input-hint {
  text-align: right;
  font-size: 12px;
  color: var(--text3);
  margin-top: 6px;
}

/* Query Stats */
.query-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.query-stat {
  flex: 1;
  background: #fafafa;
  padding: 14px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid var(--border);
}

.query-stat-highlight {
  background: var(--success-bg);
  border-color: var(--success-border);
}

.query-stat-label {
  display: block;
  font-size: 12px;
  color: var(--text3);
  font-weight: 500;
}

.query-stat-value {
  display: block;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-top: 4px;
  color: var(--text);
}

.query-stat-highlight .query-stat-value {
  color: var(--success);
}

/* Results Tabs */
.results-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  color: var(--text2);
  transition: all .2s;
}

.tab-btn:hover { background: #f5f5f5; }

.tab-btn.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* Results Table */
.results-table-wrapper { overflow-x: auto; }

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.results-table th {
  background: #f5f5f5;
  padding: 10px 12px;
  text-align: center;
  color: var(--text3);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.results-table td {
  border-bottom: 1px solid #f0f0f0;
  padding: 10px 12px;
  color: var(--text2);
  text-align: center;
}

.card-code {
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 12px;
}

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.status-valid { background: var(--success-bg); color: var(--success); }
.status-used { background: #f5f5f5; color: var(--text3); }
.status-disabled { background: var(--danger-bg); color: var(--danger); }
.status-expired { background: #fff7ed; color: #c2410c; }
.status-notfound { background: #fafafa; color: #ccc; }

.empty-row {
  text-align: center;
  padding: 24px;
  color: var(--text3);
}

/* Progress */
.progress-inline {
  background: var(--success-bg);
  color: var(--success);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: #f0f0f0;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  height: 100%;
  background: #111;
  border-radius: 2px;
  transition: width .3s ease;
}

/* Toast */
.toast {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  z-index: 2000;
  font-size: 14px;
}

/* Footer */
.footer {
  padding: 28px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text3);
  border-top: 1px solid var(--border);
  margin-top: auto;
}


/* Responsive */
@media (max-width: 640px) {
  .container { padding: 24px 16px; }
  .card { padding: 28px 20px; }
  .step-label { display: none; }
  .step-line { flex: 0 0 20px; margin-bottom: 0; }
  .title { font-size: 22px; }
  .query-stats { flex-wrap: wrap; }
  .query-stat { min-width: calc(33% - 8px); }
}
