/* MultiSocial AI — Layout e componenti base */

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

body {
  font-family: var(--font-stack);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--fin-light-bg);
}

/* ── Dark Theme (login / landing) ── */
body.theme-dark {
  background: var(--fin-dark-bg);
  color: var(--text-dark-primary);
}

/* ── Tipografia ── */
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.25; }
h2 { font-size: 1.35rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.1rem; font-weight: 600; }
p  { margin-bottom: 0.75rem; }
a  { color: var(--fin-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.container-sm { max-width: 480px; margin: 0 auto; padding: 0 20px; }

/* ── Navbar ── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--fin-dark-bg);
  border-bottom: 1px solid var(--fin-dark-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.navbar-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fin-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar-brand .badge-mvp {
  font-size: 10px;
  background: rgba(58,166,185,0.25);
  color: var(--fin-primary);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.navbar-user {
  font-size: 13px;
  color: var(--text-dark-secondary);
}

/* ── Bottoni ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border: none;
  border-radius: var(--radius-btn);
  font-family: var(--font-stack);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--fin-primary);
  color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--fin-primary-hover); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--fin-primary);
  border: 1.5px solid var(--fin-primary);
}
.btn-outline:hover:not(:disabled) { background: var(--fin-primary-light); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--fin-light-border);
}
.btn-ghost:hover:not(:disabled) { background: var(--fin-light-bg); border-color: #ccc; }

.btn-danger {
  background: var(--color-error);
  color: white;
}

.btn-pill {
  border-radius: var(--radius-pill);
  padding: 10px 28px;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: var(--radius-btn);
}
.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* ── Form ── */
.form-group { margin-bottom: 1.2rem; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--fin-light-border);
  border-radius: var(--radius-btn);
  font-family: var(--font-stack);
  font-size: 15px;
  transition: border-color var(--transition);
  background: white;
}
.form-input:focus {
  outline: none;
  border-color: var(--fin-primary);
  box-shadow: 0 0 0 3px rgba(58,166,185,0.15);
}

/* Form dark (login page) */
.theme-dark .form-input {
  background: var(--fin-dark-surface);
  border-color: var(--fin-dark-border);
  color: var(--text-dark-primary);
}
.theme-dark .form-input:focus {
  border-color: var(--fin-primary);
  box-shadow: 0 0 0 3px rgba(58,166,185,0.2);
}
.theme-dark .form-label {
  color: var(--text-dark-secondary);
}

/* ── Alert/Toast ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  margin-bottom: 1rem;
}
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* Toast popup */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--fin-dark-bg);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-btn);
  font-size: 14px;
  z-index: 9999;
  animation: toast-in 0.3s ease;
  max-width: 320px;
  box-shadow: var(--shadow-lg);
}
.toast.toast-success { border-left: 4px solid var(--color-success); }
.toast.toast-error { border-left: 4px solid var(--color-error); }
@keyframes toast-in { from { transform: translateY(20px); opacity: 0; } }

/* ── Badge status ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-ready     { background: #ecfdf5; color: #065f46; }
.badge-draft     { background: #f3f4f6; color: #4b5563; }
.badge-approved  { background: #eff6ff; color: #1e40af; }
.badge-published { background: #f0fdf4; color: #14532d; }
.badge-failed    { background: #fef2f2; color: #991b1b; }
.badge-error     { background: #fef2f2; color: #991b1b; }
.badge-transcribing  { background: #fff7ed; color: #92400e; }
.badge-analyzing     { background: #faf5ff; color: #5b21b6; }
.badge-processing_media { background: #fff7ed; color: #92400e; }
.badge-ready_review  { background: #ecfdf5; color: #065f46; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: white;
  border-radius: var(--radius-card);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--fin-light-border);
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px;
}
.modal-close:hover { color: var(--text-primary); }

/* ── Footer ── */
.fin-footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--fin-light-border);
  margin-top: 48px;
}
.fin-footer.dark {
  color: var(--text-dark-secondary);
  border-color: var(--fin-dark-border);
}
.fin-footer a { color: inherit; }

/* ── Spinner ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ── */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .container { padding: 0 12px; }
  h1 { font-size: 1.5rem; }
  .btn-pill { padding: 10px 20px; }
  .navbar { padding: 12px 16px; }
}
