/* ========================================================
   PINÁCULO — SISTEMA DE UPLOAD DE ARQUIVOS E PROJETOS
   Design System: Claro, Minimalista, Elegante & Premium
   ======================================================== */

:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #ffffff;
  --bg-project: #ffffff;
  --bg-dropzone: #f8fafc;
  --bg-dropzone-hover: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-focus: #2563eb;
  --border-dropzone: #cbd5e1;
  --border-project: #e2e8f0;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  
  --success: #059669;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  
  --error: #dc2626;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 20px 25px -5px rgba(15, 23, 42, 0.04), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-project: 0 2px 8px rgba(15, 23, 42, 0.03);
  --shadow-button: 0 4px 14px 0 rgba(15, 23, 42, 0.15);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: max(28px, env(safe-area-inset-top));
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* Container Principal */
.upload-wrapper {
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
}

/* Cabeçalho */
.upload-header {
  text-align: center;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-logo-container {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo {
  max-height: 48px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.04));
  transition: transform 0.2s ease;
}

.brand-logo:hover {
  transform: scale(1.02);
}

.main-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  line-height: 1.25;
}

.subtitle {
  font-size: clamp(14px, 3.5vw, 16px);
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 520px;
  margin: 0 auto;
}

/* Card Principal Elevado */
.upload-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Formulário e Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.company-group {
  background: #f8fafc;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.form-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.required-star {
  color: var(--accent);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input,
.input-wrapper textarea {
  width: 100%;
  padding: 13px 14px 13px 44px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: var(--transition);
}

.input-wrapper textarea {
  padding: 12px 14px 12px 44px;
  min-height: 72px;
  resize: vertical;
  line-height: 1.4;
}

.input-wrapper input:focus,
.input-wrapper textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.field-error {
  font-size: 13px;
  color: var(--error);
  margin-top: 2px;
}

/* Barra de Progresso Global */
.global-progress-card {
  background: var(--accent-light);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.3s ease;
}

.global-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #1e40af;
}

.global-progress-details {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #3b82f6;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background-color: #dbeafe;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
}

/* Container de Projetos */
.projects-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Card Individual de Projeto */
.project-card {
  background: #ffffff;
  border: 1.5px solid var(--border-project);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-project);
  position: relative;
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: border-color 0.2s ease;
}

.project-card:hover {
  border-color: #cbd5e1;
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.project-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.btn-remove-project {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-remove-project:hover {
  color: var(--error);
  background: var(--error-bg);
}

/* Dropzone interna do projeto */
.dropzone {
  border: 2px dashed var(--border-dropzone);
  border-radius: var(--radius-md);
  background: var(--bg-dropzone);
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.dropzone:hover,
.dropzone.drag-active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.file-input-hidden {
  display: none;
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.dropzone-icon-circle {
  width: 46px;
  height: 46px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.dropzone-icon-circle svg {
  width: 22px;
  height: 22px;
}

.dropzone-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.dropzone-or {
  font-size: 13px;
  color: var(--text-muted);
}

.btn-browse {
  pointer-events: auto;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-browse:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.dropzone-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* Lista de Arquivos do Projeto */
.project-files-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-files-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.file-item {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: var(--transition);
}

.file-item.uploading {
  border-color: #93c5fd;
  background: #eff6ff;
}

.file-item.success {
  border-color: var(--success-border);
  background: var(--success-bg);
}

.file-item.error {
  border-color: var(--error-border);
  background: var(--error-bg);
}

.file-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.file-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.file-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
}

.file-meta {
  min-width: 0;
  flex: 1;
}

.file-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 11px;
  color: var(--text-muted);
}

.file-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.file-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.status-waiting { background: #e2e8f0; color: #475569; }
.status-uploading { background: #dbeafe; color: #1d4ed8; }
.status-success { background: #d1fae5; color: #047857; }
.status-error { background: #fee2e2; color: #b91c1c; }

.btn-remove-file {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-remove-file:hover {
  color: var(--error);
  background: rgba(220, 38, 38, 0.1);
}

.file-progress-container {
  width: 100%;
  height: 3px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.file-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width 0.15s ease;
}

/* Botão Adicionar Outro Projeto */
.add-project-wrapper {
  display: flex;
  justify-content: center;
}

.btn-add-project {
  width: 100%;
  background: #ffffff;
  color: var(--accent);
  border: 1.5px dashed #93c5fd;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
}

.btn-add-project:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

/* Botão Principal de Envio */
.action-container {
  margin-top: 4px;
}

.btn-primary {
  width: 100%;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-button);
  transition: var(--transition);
}

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

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  width: 18px;
  height: 18px;
}

/* Status Box */
.status-box {
  text-align: center;
  padding: 24px 16px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}

.success-box {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
}

.error-box {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
}

.status-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
}

.success-icon {
  background: #10b981;
  color: #ffffff;
}

.error-icon {
  background: var(--error);
  color: #ffffff;
}

.status-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.status-desc {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 440px;
  line-height: 1.5;
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================================
   RESPONSIVIDADE (MOBILE & TABLET)
   ======================================================== */

@media (max-width: 768px) {
  .upload-card {
    padding: 24px 18px;
    gap: 22px;
  }

  .project-card {
    padding: 18px 14px;
    gap: 16px;
  }
}

@media (max-width: 640px) {
  body {
    padding: 16px 10px;
    display: block;
  }

  .upload-card {
    padding: 20px 12px;
    gap: 18px;
    border-radius: var(--radius-md);
  }

  .brand-logo {
    max-height: 40px;
  }

  .company-group {
    padding: 14px 10px;
  }

  .project-card {
    padding: 16px 12px;
  }

  .input-wrapper input,
  .input-wrapper textarea {
    font-size: 16px; /* Evita zoom no Safari iOS */
    padding: 13px 12px 13px 38px;
  }

  .input-icon {
    left: 12px;
    width: 16px;
    height: 16px;
  }

  .dropzone {
    padding: 20px 10px;
  }

  .file-name {
    font-size: 12px;
    max-width: 140px;
  }

  .btn-primary {
    padding: 15px 18px;
    min-height: 52px;
  }
}

@media (max-width: 380px) {
  .file-name {
    max-width: 100px;
  }
}
