/**
 * Baetemad — One UI 8.5 Design System
 * Glass morphism · Soft blur · Dark modern · Minimal · RTL
 * Local only — no CDN
 */

/* IRANSans loaded via assets/css/iransans.css */

:root {
  /* Brand — One UI Soft Blue / Trust Teal */
  --bae-blue-50: #E8F3FF;
  --bae-blue-100: #C5E0FF;
  --bae-blue-200: #8FC4FF;
  --bae-blue-300: #5AA8FF;
  --bae-blue-400: #3D8BFF;
  --bae-blue-500: #2474F0;
  --bae-blue-600: #1A5BC4;

  --accent: var(--bae-blue-400);
  --accent-soft: var(--bae-blue-200);
  --accent-muted: rgba(61, 139, 255, 0.14);
  --accent-glow: rgba(61, 139, 255, 0.32);

  --trust: #2DD4BF;
  --trust-muted: rgba(45, 212, 191, 0.16);

  /* Dark surfaces (One UI night) */
  --bg-base: #0A0C10;
  --bg-subtle: #12151C;
  --bg-elevated: rgba(28, 32, 42, 0.55);
  --bg-elevated-strong: rgba(36, 42, 56, 0.78);
  --bg-overlay: rgba(10, 12, 16, 0.72);
  --bg-input: rgba(20, 24, 34, 0.85);

  --text-primary: #F2F4F8;
  --text-secondary: #A8B0C0;
  --text-muted: #6B7385;
  --text-inverse: #0A0C10;

  --border-glass: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(61, 139, 255, 0.28);
  --border-subtle: rgba(255, 255, 255, 0.05);

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 4px 28px var(--accent-glow);

  --blur-sm: 12px;
  --blur-md: 24px;
  --blur-lg: 40px;

  /* One UI radius */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-2xl: 36px;
  --radius-full: 9999px;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4.5rem;

  --font: "IRANSans", Tahoma, "Segoe UI", sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 2rem;
  --fs-4xl: 2.75rem;

  --ease-fast: 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-base: 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-slow: 480ms cubic-bezier(0.2, 0.8, 0.2, 1);

  --header-h: 68px;
  --container: 1120px;
  --pad: 1.25rem;

  --success: #34D399;
  --warning: #FBBF24;
  --error: #F87171;
  --info: var(--bae-blue-400);

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
}

/* Ambient glow orbs — One UI atmosphere */
body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
}

body::before {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, rgba(61, 139, 255, 0.55), transparent 70%);
}

body::after {
  width: 360px;
  height: 360px;
  bottom: 10%;
  left: -100px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.35), transparent 70%);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent-soft);
  text-decoration: none;
  transition: color var(--ease-fast);
}

a:hover {
  color: var(--accent);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4 {
  line-height: 1.35;
  font-weight: 700;
  margin: 0 0 var(--space-md);
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 var(--space-md);
  color: var(--text-secondary);
}

/* Glass primitives */
.glass,
.glass-card {
  position: relative;
  background: var(--bg-elevated);
  backdrop-filter: blur(var(--blur-md)) saturate(1.35);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(1.35);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.glass-strong {
  background: var(--bg-elevated-strong);
  backdrop-filter: blur(var(--blur-lg)) saturate(1.4);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(1.4);
}

.glass-card {
  transition: transform var(--ease-base), box-shadow var(--ease-base), border-color var(--ease-base);
}

.glass-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.bae-container {
  width: min(100% - (var(--pad) * 2), var(--container));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.bae-section {
  padding: var(--space-2xl) 0;
}

/* Buttons — One UI soft pills */
.bae-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border: none;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: transform var(--ease-fast), box-shadow var(--ease-fast), background var(--ease-fast), opacity var(--ease-fast);
  text-decoration: none;
  line-height: 1.2;
}

.bae-btn:active {
  transform: scale(0.97);
}

.bae-btn--primary {
  background: linear-gradient(135deg, var(--bae-blue-400), var(--bae-blue-600));
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.bae-btn--primary:hover {
  color: #fff;
  box-shadow: 0 6px 32px rgba(61, 139, 255, 0.5);
}

.bae-btn--ghost {
  background: var(--bg-elevated);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  backdrop-filter: blur(var(--blur-sm));
}

.bae-btn--ghost:hover {
  border-color: var(--border-accent);
  color: var(--accent-soft);
}

.bae-btn--danger {
  background: rgba(248, 113, 113, 0.15);
  color: var(--error);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.bae-btn--sm {
  padding: 0.45rem 0.95rem;
  font-size: var(--fs-xs);
}

.bae-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Forms */
.bae-field {
  margin-bottom: var(--space-lg);
}

.bae-field label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-secondary);
}

.bae-input,
.bae-textarea,
.bae-select {
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--ease-fast), box-shadow var(--ease-fast);
}

.bae-input:focus,
.bae-textarea:focus,
.bae-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.bae-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Badges */
.bae-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--accent-muted);
  color: var(--accent-soft);
  border: 1px solid var(--border-accent);
}

.bae-badge.is-pending {
  background: rgba(251, 191, 36, 0.12);
  color: var(--warning);
  border-color: rgba(251, 191, 36, 0.3);
}

.bae-badge.is-approved,
.bae-badge.is-claimed {
  background: var(--trust-muted);
  color: var(--trust);
  border-color: rgba(45, 212, 191, 0.3);
}

.bae-badge.is-rejected {
  background: rgba(248, 113, 113, 0.12);
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.3);
}

/* Stars */
.bae-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  color: var(--warning);
  font-size: 1rem;
}

.bae-star--empty {
  color: var(--text-muted);
  opacity: 0.5;
}

.bae-star--half {
  opacity: 0.75;
}

.bae-stars__value {
  margin-inline-start: 0.4rem;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 600;
}

/* Alerts */
.bae-alert {
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
  font-size: var(--fs-sm);
  border: 1px solid transparent;
  animation: bae-fade-up 0.4s var(--ease-base);
}

.bae-alert--success {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.28);
  color: var(--success);
}

.bae-alert--error {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.28);
  color: var(--error);
}

.bae-alert--info {
  background: var(--accent-muted);
  border-color: var(--border-accent);
  color: var(--accent-soft);
}

.bae-alert--warning {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.28);
  color: var(--warning);
}

.bae-empty {
  text-align: center;
  padding: var(--space-2xl);
  color: var(--text-muted);
}

/* Animations */
@keyframes bae-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bae-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.bae-fade-up {
  animation: bae-fade-up 0.55s var(--ease-base) both;
}

.bae-fade-up-delay-1 { animation-delay: 0.08s; }
.bae-fade-up-delay-2 { animation-delay: 0.16s; }
.bae-fade-up-delay-3 { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
