/* ================================================
   VIP Casino — CFB Design System
   ================================================ */

:root {
  /* Colors — CFB Dark Theme */
  --background: #00000a;
  --foreground: hsl(0, 0%, 95%);
  --card: #0a0a14;
  --card-foreground: hsl(0, 0%, 95%);
  --popover: #0a0a14;
  --popover-foreground: hsl(0, 0%, 95%);
  --primary: #ff2150;
  --primary-foreground: #ffffff;
  --secondary: #16162a;
  --secondary-foreground: hsl(0, 0%, 95%);
  --muted: #16162a;
  --muted-foreground: hsl(240, 5%, 55%);
  --accent: #1a1a30;
  --accent-foreground: hsl(0, 0%, 95%);
  --destructive: hsl(0, 62%, 50%);
  --destructive-foreground: hsl(0, 0%, 95%);
  --border: #1e1e36;
  --input: #1e1e36;
  --ring: #ff2150;
  --radius: 0.75rem;

  /* Alpha variants */
  --primary-05: rgba(255, 33, 80, 0.05);
  --primary-08: rgba(255, 33, 80, 0.08);
  --primary-10: rgba(255, 33, 80, 0.1);
  --primary-12: rgba(255, 33, 80, 0.12);
  --primary-15: rgba(255, 33, 80, 0.15);
  --primary-20: rgba(255, 33, 80, 0.2);
  --primary-25: rgba(255, 33, 80, 0.25);
  --ring-15: rgba(255, 33, 80, 0.15);
  --destructive-10: hsla(0, 62%, 50%, 0.1);
  --destructive-30: hsla(0, 62%, 50%, 0.3);
  --border-30: rgba(30, 30, 54, 0.3);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);

  /* Font */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ════ Background ════ */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--primary-12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 50%, var(--primary-05), transparent);
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-30) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-30) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black 20%, transparent 100%);
}

/* ════ Main Container ════ */
.main-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

/* ════ Card ════ */
.card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
  animation: cardEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ════ Logo ════ */
.card-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.card-logo img {
  height: 60px;
  width: auto;
  object-fit: contain;
}

/* ════ Card Header ════ */
.card-header {
  text-align: center;
  margin-bottom: 28px;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--card-foreground);
  margin-bottom: 8px;
}

.card-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* ════ Form ════ */
.card-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

/* ════ Input ════ */
.form-input {
  height: 44px;
  padding: 0 14px;
  background: var(--background);
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: all 150ms ease;
  outline: none;
  width: 100%;
}

.form-input::placeholder {
  color: var(--muted-foreground);
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring-15);
}

.form-input.error {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px var(--destructive-10);
}

/* ════ Custom Select ════ */
.select-wrapper {
  position: relative;
}

.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: var(--background);
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 150ms ease;
  outline: none;
}

.select-trigger:hover {
  border-color: var(--muted-foreground);
}

.select-trigger:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring-15);
}

.select-trigger.has-value {
  color: var(--foreground);
}

.select-trigger.error {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px var(--destructive-10);
}

.select-chevron {
  flex-shrink: 0;
  opacity: 0.5;
  transition: transform 200ms ease;
}

.select-wrapper.open .select-chevron {
  transform: rotate(180deg);
}

.select-content {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--popover);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 4px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(0.98);
  transition: all 150ms cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 240px;
  overflow-y: auto;
}

.select-wrapper.open .select-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.select-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  font-size: 0.875rem;
  color: var(--popover-foreground);
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
  transition: background 100ms ease;
  user-select: none;
}

.select-item:hover {
  background: var(--accent);
}

.select-item.selected {
  background: var(--primary-10);
  color: var(--primary);
  font-weight: 500;
}

.select-content::-webkit-scrollbar {
  width: 6px;
}

.select-content::-webkit-scrollbar-track {
  background: transparent;
}

.select-content::-webkit-scrollbar-thumb {
  background: var(--muted);
  border-radius: 3px;
}

/* ════ Error Message ════ */
.form-error {
  font-size: 0.8rem;
  color: var(--destructive);
  min-height: 0;
  overflow: hidden;
  transition: all 150ms ease;
}

.form-error:empty {
  display: none;
}

/* ════ Submit Button ════ */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  padding: 0 20px;
  margin-top: 4px;
  background: linear-gradient(135deg, var(--primary), #ff4070);
  color: var(--primary-foreground);
  border: none;
  border-radius: calc(var(--radius) - 2px);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  position: relative;
  overflow: hidden;
}

.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1));
  opacity: 0;
  transition: opacity 200ms ease;
}

.btn-submit:hover::before {
  opacity: 1;
}

.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--primary-25);
}

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

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

.spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ════ Success Message ════ */
.success-message {
  text-align: center;
  padding: 20px 0;
  animation: cardEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: hsla(142, 71%, 45%, 0.1);
  color: hsl(142, 71%, 45%);
  margin-bottom: 20px;
}

.success-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 8px;
}

.success-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin-bottom: 24px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  background: var(--secondary);
  color: var(--secondary-foreground);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
}

.btn-secondary:hover {
  background: var(--accent);
  border-color: var(--muted-foreground);
}

/* ════ Footer ════ */
.footer-text {
  margin-top: 24px;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-align: center;
  opacity: 0.6;
}

/* ════ Toast ════ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  color: var(--foreground);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
  max-width: 360px;
}

.toast.error {
  border-color: var(--destructive-30);
}

.toast.success {
  border-color: hsla(142, 71%, 45%, 0.3);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

/* ════ Tab Navigation ════ */
.tab-nav {
  display: flex;
  gap: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 16px;
  width: 100%;
  max-width: 440px;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) - 4px);
  color: var(--muted-foreground);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms ease;
}

.tab-btn:hover {
  color: var(--foreground);
  background: var(--primary-08);
}

.tab-btn.active {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 2px 8px var(--primary-25);
}

.tab-btn svg {
  flex-shrink: 0;
}

.tab-content {
  animation: cardEnter 0.3s ease both;
}

/* ════ Check Results ════ */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.results-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
}

.results-count {
  font-size: 0.8rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 14px 16px;
  transition: border-color 200ms;
}

.result-card.status-approved {
  border-left: 3px solid hsl(142, 71%, 45%);
}

.result-card.status-rejected {
  border-left: 3px solid var(--destructive);
}

.result-card.status-pending {
  border-left: 3px solid hsl(38, 92%, 50%);
}

.result-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.result-bonus {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--foreground);
}

.result-status {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.result-status.status-pending {
  background: hsla(38, 92%, 50%, 0.1);
  color: hsl(38, 92%, 50%);
}

.result-status.status-approved {
  background: hsla(142, 71%, 45%, 0.1);
  color: hsl(142, 71%, 45%);
}

.result-status.status-rejected {
  background: var(--destructive-10);
  color: var(--destructive);
}

.result-card-meta {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--muted-foreground);
}

.result-rejection {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--destructive-10);
  border: 1px solid var(--destructive-30);
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.82rem;
  color: var(--foreground);
  line-height: 1.5;
}

.result-rejection strong {
  color: var(--destructive);
}

.check-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 0 16px;
  text-align: center;
}

.check-empty p {
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

/* ════ Responsive ════ */
@media (max-width: 480px) {
  .main-container {
    padding: 16px;
  }

  .card {
    padding: 28px 20px;
    max-width: 100%;
  }

  .card-title {
    font-size: 1.25rem;
  }

  .card-logo img {
    width: 80vw !important;
    max-width: 25rem;
  }

  .tab-nav {
    max-width: 100%;
  }

  .tab-btn {
    font-size: 0.8rem;
    padding: 8px 10px;
    gap: 4px;
  }

  .tab-btn svg {
    width: 14px;
    height: 14px;
  }

  .result-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-card-meta {
    flex-direction: column;
    gap: 4px;
  }

  .form-input {
    font-size: 16px;
  }

  .select-trigger {
    font-size: 16px;
  }

  .footer-text {
    font-size: 0.7rem;
  }
}

@media (max-width: 360px) {
  .main-container {
    padding: 10px;
  }

  .card {
    padding: 24px 16px;
  }

  .tab-btn span {
    font-size: 0.72rem;
  }

  .card-logo img {
    width: 90vw !important;
  }

  .btn-submit {
    height: 40px;
    font-size: 0.8rem;
  }
}