@import "tailwindcss";

:root {
  --minuit: #0c1628;
  --or: #c9a84c;
  --champagne: #e8d5a3;
  --parchemin: #f5f0e8;
  --encre: #08101e;
  --bronze: #8b6914;
  --ivoire: #fdfaf4;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow-gold: 0 4px 30px rgba(201, 168, 76, 0.25);
  --shadow-deep: 0 8px 40px rgba(8, 16, 30, 0.4);
  --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: "Clash Display", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --font-arabic: "Noto Naskh Arabic", serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--minuit);
  color: var(--ivoire);
  line-height: 1.6;
  opacity: 0;
  transition: opacity 0.3s ease;
}
body.loaded {
  opacity: 1;
}

.t-hero {
  font: 700 72px/1 var(--font-display);
  letter-spacing: -2px;
}
.t-h1 {
  font: 700 48px/1.1 var(--font-display);
  letter-spacing: -1px;
}
.t-h2 {
  font: 600 32px/1.2 var(--font-display);
}
.t-h3 {
  font: 600 22px/1.3 var(--font-body);
}
.t-body {
  font: 400 17px/1.7 var(--font-body);
}
.t-caption {
  font: 500 11px/1 var(--font-body);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.t-data {
  font: 700 40px/1 var(--font-mono);
  color: var(--or);
}
.t-arabic {
  font: 700 28px/1.5 var(--font-arabic);
  direction: rtl;
}

.btn-primary {
  background: linear-gradient(135deg, var(--or), #e8d5a3);
  color: var(--encre);
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-sm);
  font: 600 15px var(--font-body);
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8d5a3, var(--or));
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
}
.btn-primary:hover::before {
  opacity: 1;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201, 168, 76, 0.3);
}
.btn-ghost {
  background: transparent;
  color: var(--champagne);
  padding: 13px 31px;
  border: 1px solid rgba(232, 213, 163, 0.4);
  border-radius: var(--radius-sm);
  font: 600 15px var(--font-body);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.btn-ghost:hover {
  border-color: var(--or);
  background: rgba(201, 168, 76, 0.05);
  color: var(--or);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.1);
}

.card {
  background: var(--minuit);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: var(--radius-md);
  padding: 32px;
  transition: var(--transition);
}
.card:hover {
  border-color: rgba(201, 168, 76, 0.5);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}

.input,
.select,
.textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(232, 213, 163, 0.3);
  border-radius: var(--radius-sm);
  color: var(--ivoire);
  padding: 14px 16px;
  font: 400 16px var(--font-body);
  width: 100%;
  transition: var(--transition);
  outline: none;
  font-family: inherit;
}
.select {
  appearance: none;
  color: var(--ivoire);
}
.select option {
  color: var(--encre);
  background: var(--ivoire);
}
.textarea {
  resize: vertical;
  min-height: 120px;
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--or);
  background: rgba(201, 168, 76, 0.05);
}
.input::placeholder,
.textarea::placeholder {
  color: rgba(232, 213, 163, 0.4);
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
.delay-100 {
  transition-delay: 100ms;
}
.delay-200 {
  transition-delay: 200ms;
}
.delay-300 {
  transition-delay: 300ms;
}
.delay-400 {
  transition-delay: 400ms;
}
.delay-500 {
  transition-delay: 500ms;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
@keyframes pulse-glow {
  0%,
  100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}
@keyframes bg-pan {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 400px 400px;
  }
}

#ticker {
  width: 100%;
  background: var(--encre);
  overflow: hidden;
  white-space: nowrap;
  padding: 12px 0;
  border-bottom: 1px solid rgba(201, 168, 76, 0.15);
}
.ticker-content {
  display: inline-block;
  animation: scroll-ticker 30s linear infinite;
}
@keyframes scroll-ticker {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

#nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(12, 22, 40, 0.8);
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
  transition: background 0.3s;
}
#nav.scrolled {
  background: rgba(12, 22, 40, 0.98);
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-logo {
  text-decoration: none;
  display: flex;
  flex-direction: column;
}
.nav-logo-en {
  font: 700 24px var(--font-display);
  color: var(--or);
  letter-spacing: 1px;
}
.nav-logo-ar {
  font: 700 13px var(--font-arabic);
  color: var(--champagne);
  margin-top: -4px;
}
.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav-links a.nav-link {
  color: var(--ivoire);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a.nav-link:hover {
  color: var(--or);
}
.nav-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toast {
  background: var(--encre);
  color: var(--ivoire);
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-deep);
  display: flex;
  align-items: center;
  min-width: 300px;
  border-left: 4px solid var(--champagne);
  transform: translateX(100%);
  opacity: 0;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.active {
  transform: translateX(0);
  opacity: 1;
}
.toast.success {
  border-left-color: var(--or);
}
.toast.error {
  border-left-color: #e05c40;
}

#loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 16, 30, 0.8);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
}
#loader-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.dots {
  display: flex;
  gap: 8px;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--or);
  animation: pulse 1.5s infinite ease-in-out;
}
.dot:nth-child(2) {
  animation-delay: 0.2s;
}
.dot:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes pulse {
  0%,
  100% {
    transform: scale(0.5);
    opacity: 0.5;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 16, 30, 0.7);
  z-index: 1500;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--minuit);
  border: 1px solid var(--or);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 560px;
  width: 100%;
  margin: 24px;
  transform: translateY(20px);
  transition: 0.3s;
  box-shadow: var(--shadow-deep);
}
.modal-overlay.active .modal {
  transform: translateY(0);
}

/* Utility classes */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.text-center {
  text-align: center;
}
.mt-1 {
  margin-top: 4px;
}
.mt-2 {
  margin-top: 8px;
}
.mt-4 {
  margin-top: 16px;
}
.mt-8 {
  margin-top: 32px;
}
.mt-16 {
  margin-top: 64px;
}
.mb-1 {
  margin-bottom: 4px;
}
.mb-2 {
  margin-bottom: 8px;
}
.mb-4 {
  margin-bottom: 16px;
}
.mb-8 {
  margin-bottom: 32px;
}
.mb-16 {
  margin-bottom: 64px;
}
.py-16 {
  padding-top: 64px;
  padding-bottom: 64px;
}
.py-24 {
  padding-top: 96px;
  padding-bottom: 96px;
}
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-2 {
  gap: 8px;
}
.gap-4 {
  gap: 16px;
}
.gap-8 {
  gap: 32px;
}
.grid {
  display: grid;
}
.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.text-or {
  color: var(--or);
}
.text-ivoire {
  color: var(--ivoire);
}
.text-minuit {
  color: var(--minuit);
}
.text-champagne {
  color: var(--champagne);
}
.text-encre {
  color: var(--encre);
}
.bg-minuit {
  background-color: var(--minuit);
}
.bg-parchemin {
  background-color: var(--parchemin);
}
.bg-encre {
  background-color: var(--encre);
}
.bg-ivoire {
  background-color: var(--ivoire);
}
.w-full {
  width: 100%;
}
.max-w-md {
  max-width: 448px;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.border-b {
  border-bottom: 1px solid rgba(201, 168, 76, 0.2);
}
.error-text {
  color: #e05c40;
  font-size: 14px;
  margin-top: 4px;
  display: none;
}
.input.invalid {
  border-color: #e05c40;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .t-hero { font-size: 56px; }
  .t-h1 { font-size: 40px; }
  .grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .nav-container { padding: 16px 24px; gap: 16px; }
  .nav-links { gap: 16px; }
  .nav-actions { gap: 8px; }
  .btn-primary, .btn-ghost { padding: 8px 16px; font-size: 13px; }
}

@media (max-width: 768px) {
  .t-hero { font-size: 42px; }
  .t-h1 { font-size: 32px; }
  .t-h2 { font-size: 28px; }
  
  .grid-cols-2,
  .grid-cols-3 {
    grid-template-columns: 1fr;
  }
  
  .nav-container {
    overflow-x: auto;
    padding: 16px;
    gap: 24px;
    justify-content: flex-start;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
  }
  .nav-container::-webkit-scrollbar {
    display: none;
  }
  .nav-links {
    gap: 16px;
  }
  .nav-logo, .nav-links, .nav-actions {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .nav-actions {
    gap: 8px;
  }
  .btn-primary, .btn-ghost {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  .container {
    padding: 0 16px;
  }
  .py-24 {
    padding-top: 64px;
    padding-bottom: 64px;
  }
  .card {
    padding: 24px;
  }
  main .btn-primary, main .btn-ghost, .pricing-card .btn-primary {
    width: 100%;
    text-align: center;
  }
}

/* Auth Layout */
.auth-layout { display: flex; height: 100vh; overflow: hidden; margin: 0; }
.auth-layout-left, .auth-layout-right { flex: 1; padding: 48px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.auth-layout-left { background-color: var(--minuit); border-right: 1px solid rgba(201,168,76,0.2); }
.auth-layout-right { background-color: var(--ivoire); }

@media (max-width: 768px) {
  .auth-layout { flex-direction: column; overflow: auto; height: auto; min-height: 100vh; }
  .auth-layout-left { border-right: none; border-bottom: 1px solid rgba(201,168,76,0.2); padding: 32px 16px; flex: none; }
  .auth-layout-right { padding: 32px 16px; justify-content: flex-start; flex: 1; }
}