:root {
  --background: #f8fafc;
  --foreground: #1f2937;
  --card: #ffffff;
  --muted: #64748b;
  --muted-foreground: #6b7280;
  --border: #e5e7eb;
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--foreground);
  background:
    radial-gradient(circle at 20% 12%, rgba(14, 165, 233, 0.28), transparent 32%),
    radial-gradient(circle at 82% 18%, rgba(16, 185, 129, 0.2), transparent 30%),
    linear-gradient(135deg, #07111f 0%, #10243b 52%, #07111f 100%);
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-container {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 18px;
  padding: 34px;
  box-shadow: var(--shadow);
  text-align: center;
}

.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.logo-icon {
  width: 78px;
  height: 78px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 38px;
  color: white;
  background: linear-gradient(135deg, #0ea5e9, #10b981);
  box-shadow: 0 14px 35px rgba(14, 165, 233, 0.34);
}

.login-container h1,
header h1 {
  margin: 0;
  line-height: 1.12;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  color: #1f2937;
}

.welcome-section {
  margin: 22px 0;
}

.welcome-text {
  margin: 0;
  color: #0369a1;
  font-size: 1.45rem;
}

.welcome-subtitle,
.credentials-text,
.disclaimer-text {
  color: var(--muted);
  margin: 8px 0 0;
}

form {
  display: grid;
  gap: 14px;
}

input[type="text"],
input[type="password"],
input[type="number"] {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: white;
  color: #111827;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.country-select {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: white;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  appearance: none;
}

.country-picker {
  position: relative;
}

.country-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.76rem;
}

.country-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  display: none;
  max-height: 250px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: white;
  box-shadow: var(--shadow);
}

.country-picker.active .country-menu {
  display: grid;
  gap: 4px;
}

.country-option {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: white;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  text-align: left;
}

.country-option:hover {
  background: #eff6ff;
}

.flag-img {
  flex: 0 0 auto;
  width: 34px;
  height: 22px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid rgba(15, 23, 42, 0.22);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
}

.zip-form-group {
  display: grid;
  gap: 6px;
  text-align: left;
}

.zip-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.checkbox-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #374151;
  font-size: 0.92rem;
}

.checkbox-container input {
  width: 18px;
  height: 18px;
}

.terms-link {
  padding: 0;
  border: 0;
  color: var(--primary);
  background: transparent;
  text-decoration: underline;
}

.login-button,
.get-logins-button,
.deriv-link,
.btn {
  border: 0;
  border-radius: 12px;
  padding: 13px 20px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.login-button:hover,
.get-logins-button:hover,
.deriv-link:hover,
.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.login-button,
.btn-primary {
  color: white;
  background: linear-gradient(135deg, #0284c7, #0f766e);
  box-shadow: 0 12px 24px rgba(14, 116, 144, 0.24);
}

.credentials-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.homepage-actions {
  margin-bottom: 16px;
}

.get-logins-button {
  margin-top: 10px;
  width: 100%;
  color: white;
  background: linear-gradient(135deg, #10b981, #059669);
}

.new-user-button {
  width: 100%;
  margin-top: 10px;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 13px 20px;
  color: #0369a1;
  background: #eff6ff;
  font-weight: 800;
}

.disclaimer-section {
  margin-top: 16px;
  padding: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 12px;
}

.deriv-link {
  margin-top: 16px;
  width: 100%;
  color: white;
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.error-message {
  display: none;
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.9rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.72);
}

.modal-content,
.risk-modal,
.admin-modal {
  width: min(92vw, 560px);
  max-height: 90vh;
  overflow-y: auto;
  background: white;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.modal-header,
.modal-footer {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.modal-footer {
  border-top: 1px solid var(--border);
  border-bottom: 0;
  justify-content: flex-end;
}

.modal-body {
  text-align: left;
  padding: 22px;
  color: #374151;
}

.request-form {
  padding: 22px;
}

.request-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: left;
}

.request-footer {
  margin: 12px -22px -22px;
}

.modal-body h4,
.modal-body h5 {
  color: #111827;
  margin-bottom: 8px;
}

.modal-body p,
.modal-body li {
  line-height: 1.55;
}

.close-button,
.close-button-secondary,
.accept-button {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
}

.close-button {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 24px;
  color: #64748b;
  background: #f1f5f9;
}

.accept-button {
  color: white;
  background: var(--success);
}

.close-button-secondary {
  background: #e5e7eb;
  color: #374151;
}

#dashboard {
  min-height: 100vh;
  --background: #07111f;
  --foreground: #f8fafc;
  --card: #101b2d;
  --muted: #94a3b8;
  --muted-foreground: #cbd5e1;
  --border: #20314a;
  background:
    linear-gradient(180deg, rgba(14, 165, 233, 0.12), transparent 240px),
    radial-gradient(circle at 85% 10%, rgba(16, 185, 129, 0.13), transparent 30%),
    var(--background);
  color: var(--foreground);
  transition: background 0.2s, color 0.2s;
}

#dashboard.dark {
  --background: #f6f8fb;
  --foreground: #172033;
  --card: #ffffff;
  --muted: #64748b;
  --muted-foreground: #64748b;
  --border: #dbe4ef;
  background: linear-gradient(180deg, #eef7ff, #f8fafc 280px);
}

.container {
  position: relative;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.theme-toggle {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 58px;
  height: 30px;
  border-radius: 999px;
  background: #0ea5e9;
  padding: 3px;
  cursor: pointer;
}

.theme-toggle-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}

#dashboard.dark .theme-toggle {
  background: #cbd5e1;
}

#dashboard.dark .theme-toggle-circle {
  transform: translateX(28px);
}

.logout-btn,
.risk-calculator-btn,
.admin-users-btn {
  position: absolute;
  right: 20px;
  z-index: 10;
}

.logout-btn {
  top: 20px;
}

.risk-calculator-btn {
  top: 72px;
  background: linear-gradient(135deg, #f59e0b, #dc2626);
  color: white;
}

.admin-users-btn {
  top: 124px;
  color: white;
  background: linear-gradient(135deg, #0ea5e9, #0f766e);
}

header {
  text-align: center;
  padding-top: 46px;
  margin-bottom: 24px;
}

#dashboard.dark header h1,
#dashboard.dark .login-container h1 {
  color: var(--foreground);
}

#dashboard header h1 {
  color: var(--foreground);
}

.header-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.btn-sm {
  padding: 10px 14px;
  min-height: 38px;
  font-size: 0.88rem;
}

.btn-lg {
  min-height: 50px;
  padding: 13px 24px;
}

.btn-outline {
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--border);
}

.btn-destructive {
  color: white;
  background: linear-gradient(135deg, #ef4444, #991b1b);
}

.btn-success {
  color: white;
  background: linear-gradient(135deg, #22c55e, #047857);
}

.bg-purple-500 {
  color: white;
  background: linear-gradient(135deg, #2563eb, #0f766e);
}

.bg-orange-500 {
  color: white;
  background: linear-gradient(135deg, #f59e0b, #b45309);
}

.btn-even {
  color: white;
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
}

.btn-odd {
  color: white;
  background: linear-gradient(135deg, #14b8a6, #0f766e);
}

.predict-btn {
  animation: predict-glow 1.7s infinite alternate;
}

@keyframes predict-glow {
  from { box-shadow: 0 0 8px rgba(14, 165, 233, 0.48); }
  to { box-shadow: 0 0 24px rgba(16, 185, 129, 0.74); }
}

.dropdown {
  position: relative;
}

.dropdown-content {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  min-width: 230px;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 20;
  display: none;
}

.dropdown.active .dropdown-content {
  display: block;
}

.dropdown-item {
  padding: 12px 14px;
  color: var(--foreground);
  text-align: left;
  cursor: pointer;
}

.dropdown-item:hover {
  background: rgba(59, 130, 246, 0.1);
}

.prediction-result-card,
.price-display-container,
.analysis-btn-container,
.grid-container,
.strategy-container,
.progress-container,
.prediction-container,
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.prediction-result-card {
  width: min(760px, 100%);
  margin: 0 auto 18px;
  padding: 16px 24px;
  text-align: center;
  border: 1px solid rgba(16, 185, 129, 0.5);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(14, 165, 233, 0.08));
}

.prediction-result-title {
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.75rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.prediction-result-value {
  font-size: clamp(1.2rem, 3.5vw, 1.6rem);
  font-weight: 800;
}

.prediction-result-market {
  margin-top: 8px;
  color: var(--muted-foreground);
  font-size: 0.84rem;
}

.price-display-container {
  width: min(520px, 100%);
  margin: 0 auto 18px;
}

.price-card {
  padding: 18px;
  text-align: center;
}

.price-title {
  color: var(--muted-foreground);
  font-weight: 700;
  margin-bottom: 8px;
}

.price-value {
  font-size: clamp(2rem, 7vw, 3.5rem);
  font-weight: 900;
  color: #22c55e;
  font-variant-numeric: tabular-nums;
}

.analysis-btn-container {
  position: relative;
  width: min(420px, 100%);
  margin: 0 auto 24px;
  padding: 18px;
  text-align: center;
}

.loading-spinner {
  display: none;
  width: 32px;
  height: 32px;
  margin: 14px auto 0;
  border: 4px solid #e5e7eb;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

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

.grid-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding: 22px;
  margin-bottom: 22px;
}

.grid-title {
  text-align: center;
  margin: 0 0 14px;
  color: var(--foreground);
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
  gap: 10px;
}

.number-btn {
  aspect-ratio: 1;
  min-height: 48px;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  font-size: 1.15rem;
}

.number-btn.active {
  color: white;
  background: linear-gradient(135deg, #0ea5e9, #10b981);
  border-color: transparent;
}

.strategy-container {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  margin-bottom: 22px;
}

.progress-container {
  display: grid;
  gap: 14px;
  padding: 18px;
  margin-bottom: 22px;
}

.progress-bar {
  height: 28px;
  border-radius: 999px;
  background: var(--background);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #22c55e, #0ea5e9);
  transition: width 0.2s;
}

.progress-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.prediction-container {
  padding: 20px;
  margin-bottom: 22px;
  text-align: center;
}

.prediction-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.prediction-number {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  font-size: 2.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, #020617, #0284c7);
  box-shadow: 0 16px 30px rgba(14, 165, 233, 0.28);
}

.countdown,
.winning-message {
  margin-top: 14px;
  font-weight: 800;
}

.charts-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.chart-card {
  overflow: hidden;
}

.chart-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.chart-title {
  margin: 0;
  font-size: 1.05rem;
}

.chart-content {
  height: 330px;
  padding: 16px;
  position: relative;
}

canvas {
  width: 100%;
  height: 100%;
}

.digit-display {
  position: absolute;
  right: 16px;
  bottom: 14px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.82);
  color: white;
  font-weight: 800;
}

.trade-notification {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  width: min(360px, calc(100vw - 40px));
  padding: 16px 18px;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, #111827, #2563eb);
  box-shadow: var(--shadow);
  transform: translateY(130%);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
}

.trade-notification.show {
  opacity: 1;
  transform: translateY(0);
}

.trade-notification-title {
  font-weight: 900;
  margin-bottom: 5px;
}

.risk-modal {
  padding: 28px;
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.admin-modal {
  width: min(96vw, 920px);
  background: var(--card);
  color: var(--foreground);
}

.admin-auth-modal {
  max-width: 430px;
}

.admin-storage-label {
  margin: 6px 0 0;
  color: var(--muted-foreground);
  font-size: 0.84rem;
}

.admin-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 14px 18px 0;
}

.admin-users-body {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.admin-message,
.empty-users {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  background: rgba(14, 165, 233, 0.12);
  color: var(--foreground);
}

.user-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--background);
}

.user-name {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 1.05rem;
  font-weight: 900;
}

.user-meta {
  color: var(--muted-foreground);
  font-size: 0.88rem;
  line-height: 1.5;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 130px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pending {
  color: #92400e;
  background: #fef3c7;
}

.status-active {
  color: #065f46;
  background: #d1fae5;
}

.status-inactive {
  color: #991b1b;
  background: #fee2e2;
}

.risk-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.risk-modal h2 {
  margin: 0;
  font-size: 1.5rem;
}

.risk-modal label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.risk-modal input {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.risk-modal input::placeholder {
  color: rgba(255, 255, 255, 0.68);
}

.risk-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.risk-result,
.risk-tips {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
}

.risk-row {
  margin-top: 12px;
}

.risk-label {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
}

.risk-value {
  margin-top: 3px;
  font-size: 1.35rem;
  font-weight: 900;
}

.risk-tips ul {
  margin-bottom: 0;
  padding-left: 20px;
  line-height: 1.5;
}

.whatsapp-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  font-weight: 900;
  text-decoration: none;
  transition: transform 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
  will-change: transform;
}

.whatsapp-float:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.36);
}

.whatsapp-float-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.68rem;
  letter-spacing: 0;
}

@media (max-width: 820px) {
  .container {
    padding-top: 90px;
  }

  .logout-btn {
    top: 20px;
  }

  .risk-calculator-btn {
    top: 70px;
  }

  .admin-users-btn {
    top: 120px;
  }

  header {
    padding-top: 34px;
  }

  .grid-container,
  .charts-container {
    grid-template-columns: 1fr;
  }

  .strategy-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .login-container {
    padding: 26px 20px;
  }

  .theme-toggle,
  .logout-btn,
  .risk-calculator-btn,
  .admin-users-btn {
    position: static;
    margin: 0 8px 10px 0;
  }

  .container {
    padding-top: 18px;
  }

  header {
    padding-top: 8px;
  }

  .header-buttons,
  .prediction-buttons {
    align-items: stretch;
  }

  .header-buttons > *,
  .header-buttons .btn,
  .prediction-buttons .btn {
    width: 100%;
  }

  .strategy-container,
  .risk-actions {
    grid-template-columns: 1fr;
  }

  .number-grid {
    grid-template-columns: repeat(5, minmax(34px, 1fr));
    gap: 8px;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .user-actions {
    min-width: 0;
  }

  .whatsapp-float {
    right: 12px;
    bottom: 12px;
    min-height: 44px;
    padding: 10px 13px;
  }
}
