/* =========================================================
   megasharex — Design System
   Dark premium SaaS theme
   ========================================================= */

:root {
  --ww-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --ww-bg: #0b1120;
  --ww-bg-elevated: #111827;
  --ww-surface: #151f32;
  --ww-surface-2: #1a2740;
  --ww-surface-3: #1f3050;
  --ww-border: rgba(148, 163, 184, 0.14);
  --ww-border-strong: rgba(148, 163, 184, 0.28);

  --ww-text: #f1f5f9;
  --ww-text-2: #cbd5e1;
  --ww-text-muted: #94a3b8;

  --ww-accent: #10b981;
  --ww-accent-hover: #059669;
  --ww-accent-soft: rgba(16, 185, 129, 0.12);
  --ww-accent-glow: rgba(16, 185, 129, 0.35);

  --ww-blue: #3b82f6;
  --ww-blue-soft: rgba(59, 130, 246, 0.12);

  --ww-danger: #ef4444;
  --ww-success: #22c55e;
  --ww-warning: #f59e0b;

  --ww-radius-sm: 8px;
  --ww-radius-md: 12px;
  --ww-radius-lg: 16px;
  --ww-radius-xl: 24px;

  --ww-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --ww-shadow-md: 0 8px 32px rgba(0, 0, 0, 0.35);
  --ww-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.45);

  --ww-header-h: 72px;
  --ww-max-w: 1200px;
  --ww-section-py: 5.5rem;
}

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

html {
  scroll-behavior: smooth;
}

body.ww-root {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ww-font);
  background: var(--ww-bg);
  color: var(--ww-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

.ww-container {
  width: min(100% - 2.5rem, var(--ww-max-w));
  margin-inline: auto;
}

.ww-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.ww-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--ww-accent), #34d399);
  border-radius: var(--ww-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #052e1f;
  font-weight: 800;
  font-size: 1rem;
}

.ww-section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ww-accent);
  margin-bottom: 1rem;
}

.ww-section-label::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--ww-accent);
  border-radius: 2px;
}

.ww-section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.ww-section-desc {
  font-size: 1.0625rem;
  color: var(--ww-text-muted);
  max-width: 640px;
  margin: 0 0 2.5rem;
}

/* Buttons */
[hidden] {
  display: none !important;
}

.ww-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--ww-radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.15s,
    box-shadow 0.2s;
  white-space: nowrap;
}

.ww-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ww-btn-primary {
  background: var(--ww-accent);
  color: #052e1f;
  box-shadow: 0 4px 20px var(--ww-accent-glow);
}

.ww-btn-primary:hover:not(:disabled) {
  background: var(--ww-accent-hover);
  transform: translateY(-1px);
}

.ww-btn-secondary {
  background: transparent;
  border-color: var(--ww-border-strong);
  color: var(--ww-text);
}

.ww-btn-secondary:hover:not(:disabled) {
  background: var(--ww-surface-2);
  border-color: var(--ww-text-muted);
}

.ww-btn-danger {
  background: var(--ww-danger);
  border-color: var(--ww-danger);
  color: #fff;
}

.ww-btn-danger:hover:not(:disabled) {
  filter: brightness(1.05);
}

.ww-btn-ghost {
  background: var(--ww-accent-soft);
  color: var(--ww-accent);
  border-color: transparent;
}

.ww-btn-ghost:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.2);
}

.ww-btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* Forms */
.ww-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.ww-form-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ww-text-2);
}

.ww-input {
  width: 100%;
  padding: 0.8125rem 1rem;
  background: var(--ww-bg);
  border: 1px solid var(--ww-border-strong);
  border-radius: var(--ww-radius-md);
  color: var(--ww-text);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.ww-input::placeholder {
  color: var(--ww-text-muted);
}

.ww-input:focus {
  outline: none;
  border-color: var(--ww-accent);
  box-shadow: 0 0 0 3px var(--ww-accent-soft);
}

.ww-form-error {
  display: none;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--ww-radius-md);
  color: #fca5a5;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.ww-form-error.is-visible {
  display: block;
}

/* Cards */
.ww-card {
  background: var(--ww-surface);
  border: 1px solid var(--ww-border);
  border-radius: var(--ww-radius-lg);
  padding: 1.75rem;
}

/* Image placeholder */
.ww-img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--ww-surface-2);
  border: 2px dashed var(--ww-border-strong);
  border-radius: var(--ww-radius-lg);
  color: var(--ww-text-muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 2rem;
  min-height: 200px;
}

.ww-img-placeholder svg {
  opacity: 0.5;
}

.ww-img-placeholder span {
  font-weight: 600;
  color: var(--ww-text-2);
}

/* Toast */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  pointer-events: none;
}

@media (max-width: 640px) {
  .toast-container {
    top: 0.75rem;
    right: 0.75rem;
    left: 0.75rem;
  }
}

.toast-msg {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--ww-surface-3);
  border: 1px solid var(--ww-border-strong);
  border-radius: var(--ww-radius-md);
  box-shadow: var(--ww-shadow-md);
  color: var(--ww-text);
  font-size: 0.875rem;
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  opacity: 0;
  transform: translateY(-0.5rem);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

@media (max-width: 640px) {
  .toast-msg {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}

.toast-msg.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-msg[hidden] {
  display: none;
}

.toast-msg.is-success {
  border-color: rgba(34, 197, 94, 0.4);
}

.toast-msg.is-error {
  border-color: rgba(239, 68, 68, 0.4);
}

.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--ww-text-muted);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
}

.toast-close:hover {
  color: var(--ww-text);
}

/* Utility */
.ww-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
