/**
 * Flinechat Design System – Phase 2
 * Premium monochrome (black & white) only.
 * Interface language: English. User content may be Persian (dir=auto).
 */
:root {
  --bg: #000000;
  --bg-elevated: #0A0A0A;
  --surface: #111111;
  --surface-2: #181818;
  --surface-3: #1F1F1F;
  --border: #303030;
  --border-subtle: #252525;
  --text: #FFFFFF;
  --text-secondary: #A0A0A0;
  --text-muted: #666666;
  --text-inverse: #000000;
  --white: #FFFFFF;
  --black: #000000;
  --danger: #E8E8E8;
  --danger-bg: #1A1A1A;
  --success: #FFFFFF;
  --focus: #FFFFFF;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --msg-me-bg: #1A1A1A;
  --msg-me-border: #404040;
  --msg-other-bg: #111111;
  --msg-other-border: #2A2A2A;
  --input-bg: #0A0A0A;
  --overlay: rgba(0, 0, 0, 0.75);
  --transition: 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Bidirectional text for user-generated content */
.msg-text,
.message-content,
[data-user-content],
.chat-message-body {
  unicode-bidi: plaintext;
  direction: auto;
  text-align: start;
}

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
  outline: none;
}

/* Shared form controls */
.fc-input,
input[type="text"],
input[type="password"],
input[type="tel"],
textarea,
select {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  width: 100%;
  transition: border-color var(--transition), background var(--transition);
}
.fc-input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--white);
  background: var(--surface);
}

.fc-btn,
button.fc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.fc-btn-primary {
  background: var(--white);
  color: var(--black);
}
.fc-btn-primary:hover { background: #E8E8E8; }
.fc-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.fc-btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.fc-btn-secondary:hover {
  background: var(--surface-2);
  border-color: #505050;
}
.fc-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.fc-btn-ghost:hover {
  color: var(--text);
  background: var(--surface);
}

.fc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}

.fc-toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
}

/* Skeleton */
.fc-skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: fc-shimmer 1.2s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes fc-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
