/* Dr. Licitação – Premium Design v6 */

:root {
  --primary: #FF8C00;
  --primary-light: #FFA726;
  --bg: #0a0a0a;
  --card-bg: #1a1a1a;
  --card-border: #333;
  --text: #ffffff;
  --text-sec: #A5A5A5;
  --text-muted: #6b6b6b;
  --success: #00ff88;
  --danger: #ff4444;
  --radius: 10px;
  --radius-lg: 12px;
  --shadow: 0 8px 24px rgba(255,140,0,0.1);
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

* { margin:0; padding:0; box-sizing:border-box; }
html { height: 100%; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  line-height: 1.55;
}
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
  background-size: 18px 18px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.6;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  background: transparent;
  position: relative;
  margin-bottom: 32px;
}
.logo-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
}
.logo-icon {
  width: 48px; height: 48px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px;
  color: #000;
  box-shadow: 0 6px 20px rgba(255,140,0,0.3);
  transition: var(--transition);
  padding: 6px;
}
.logo-icon svg {
  width: 100%;
  height: 100%;
  stroke: #000;
}
.logo-link:hover .logo-icon {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(255,140,0,0.4);
}
.logo-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.25;
}
.logo-text {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.3px;
  background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-subtitle {
  font-size: 0.8125rem;
  color: var(--text-sec);
  font-weight: 500;
}
.logo-org {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
}
.user-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.btn-new-doc {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,128,0,0.1);
  color: #00cc66;
  border: 1px solid rgba(0,128,0,0.3);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-new-doc:hover {
  background: rgba(0,128,0,0.2);
  border-color: #00cc66;
}
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}
.welcome-msg {
  font-size: 0.875rem;
  color: var(--text-sec);
}
.btn-logout {
  background: rgba(255,140,0,0.1);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-logout:hover {
  background: rgba(255,140,0,0.2);
  border-color: var(--primary-light);
  color: var(--primary-light);
}

/* Progress */
.progress-section {
  margin-bottom: 40px;
  flex-shrink: 0;
  padding: 20px 0;
}
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
}
.progress-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.progress-steps {
  display: flex;
  gap: 24px;
  margin-bottom: 16px;
  justify-content: center;
  position: relative;
  width: 80%;
  margin-left: auto;
  margin-right: auto;
}
.step-circle {
  width: 40px; height: 40px;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-sec);
  cursor: pointer;
  transition: var(--transition);
  z-index: 1;
  position: relative;
  flex-shrink: 0;
}
.step-circle:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.step-circle.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
  box-shadow: 0 0 0 6px rgba(255,140,0,0.2);
}
.step-circle.completed {
  background: var(--success);
  border-color: var(--success);
  color: #000;
}
.progress-bar-container {
  height: 4px;
  background: var(--card-border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-sec);
  font-weight: 500;
  margin-top: 12px;
}

/* Form Panel - altura automática */
.form-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.35s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-panel {
  display: none;
}
.step-panel.active {
  display: block;
  animation: slideIn 0.25s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.step-panel h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
  background: linear-gradient(135deg, #fff 0%, var(--primary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}
.step-subtitle {
  color: var(--text-sec);
  font-size: 0.875rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Form Layout */
.form-section { margin-bottom: 28px; }
.field-group { margin-bottom: 18px; }
.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.required-star {
  color: var(--primary);
  font-weight: 800;
}
.input-wrapper,.textarea-wrapper,.select-wrapper { position: relative; }
.input-field,.textarea-field,.select-field {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  transition: var(--transition);
  line-height: 1.4;
}
.input-field:focus,.textarea-field:focus,.select-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,140,0,0.15);
}
.input-field::placeholder,.textarea-field::placeholder {
  color: var(--text-sec);
  opacity: 0.5;
}
.textarea-field {
  resize: vertical;
  min-height: 90px;
}
.select-field {
  appearance: none;
  cursor: pointer;
  padding-right: 42px;
}
.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-sec);
  pointer-events: none;
  transition: var(--transition);
}
.select-wrapper:hover .select-arrow { color: var(--primary); }
.char-counter {
  position: absolute;
  right: 10px;
  bottom: 6px;
  font-size: 0.6875rem;
  color: var(--text-sec);
  font-family: 'JetBrains Mono', monospace;
  background: var(--card-bg);
  padding: 1px 4px;
  border-radius: 3px;
}
.hint { margin-top: 4px; font-size: 0.75rem; color: var(--text-sec); }

/* Grid */
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 18px;
}
@media (max-width: 1200px) {
  .field-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* Items Table */
.table-section { margin-top: 24px; }
.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.table-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
}
.table-container {
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
}
.items-table {
  width: 100%;
  border-collapse: collapse;
}
.items-table th,
.items-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}
.items-table th {
  background: rgba(255,140,0,0.1);
  color: var(--primary-light);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.items-table tbody tr:hover { background: var(--card-bg); }
.items-table input,
.items-table select {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 0.8125rem;
  transition: var(--transition);
}
.items-table input:focus,
.items-table select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255,140,0,0.15);
}
.cell-total {
  font-weight: 700;
  color: var(--primary-light);
  text-align: right !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
}
.btn-remove-row {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-sec);
  width: 30px; height: 30px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.btn-remove-row:hover {
  background: rgba(239,68,68,0.1);
  border-color: var(--danger);
  color: var(--danger);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  letter-spacing: 0.3px;
}
.btn-secondary {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--card-border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--card-border);
  border-color: var(--primary);
  color: var(--primary);
}
.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--primary);
  color: #000;
  box-shadow: 0 4px 12px rgba(255,140,0,0.25);
}
.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255,140,0,0.35);
}
.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,140,0,0.1);
  color: var(--primary);
  border: 1px solid rgba(255,140,0,0.3);
  padding: 8px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: var(--transition);
}
.btn-add:hover {
  background: rgba(255,140,0,0.2);
  border-color: var(--primary);
  transform: translateY(-1px);
}

/* Dynamic Items */
.dynamic-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.dynamic-row {
  display: flex;
  gap: 8px;
  animation: fadeInUp 0.25s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.dynamic-row input {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.875rem;
  transition: var(--transition);
}
.dynamic-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,140,0,0.15);
}
.btn-remove-dynamic {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-sec);
  width: 34px; height: 38px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.btn-remove-dynamic:hover {
  background: rgba(239,68,68,0.1);
  border-color: var(--danger);
  color: var(--danger);
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
}

/* Generate Actions */
.generate-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  margin-bottom: 16px;
}
.generate-btn {
  flex: 1;
  justify-content: center;
  padding: 10px 14px;
  font-size: 0.8125rem;
}

/* New Generation Button */
.new-generation-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: rgba(0,128,0,0.1);
  color: #00cc66;
  border: 1px solid rgba(0,128,0,0.3);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 12px;
}
.new-generation-btn:hover {
  background: rgba(0,128,0,0.2);
  border-color: #00cc66;
}

/* Info Box */
.info-box {
  background: linear-gradient(135deg, rgba(255,140,0,0.12) 0%, rgba(255,140,0,0.05) 100%);
  border: 1px solid rgba(255,140,0,0.3);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 16px;
  animation: pulse-border 2s infinite;
}
@keyframes pulse-border {
  0%, 100% { border-color: rgba(255,140,0,0.3); }
  50% { border-color: rgba(255,140,0,0.6); }
}
.info-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.info-content {
  flex: 1;
}
.info-content strong {
  display: block;
  color: var(--primary);
  font-size: 0.875rem;
  margin-bottom: 6px;
  font-weight: 700;
}
.info-content p {
  color: var(--text-sec);
  font-size: 0.8125rem;
  line-height: 1.5;
  margin: 0;
}

/* Blocked Overlay */
.blocked-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.blocked-modal {
  background: var(--card-bg);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
  padding: 36px;
  text-align: center;
  max-width: 440px;
  box-shadow: 0 16px 48px rgba(255,140,0,0.2);
}
.blocked-icon {
  font-size: 3rem;
  margin-bottom: 18px;
  filter: grayscale(0.3);
}
.blocked-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
}
.blocked-text {
  color: var(--text-sec);
  line-height: 1.6;
  margin-bottom: 20px;
}
.blocked-btn {
  background: var(--primary);
  color: #000;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.blocked-btn:hover {
  background: var(--primary-light);
}

/* Responsive */
@media (max-width: 1600px) {
  .container { padding: 0 20px; }
  .form-panel { padding: 24px; }
}
@media (max-width: 1200px) {
  .container { padding: 0 16px; }
  .form-panel { padding: 20px; }
}
@media (max-width: 768px) {
  .container { padding: 0 12px; }
  .header { padding: 12px 0; margin-bottom: 20px; flex-direction: column; gap: 12px; }
  .user-actions { width: 100%; justify-content: space-between; }
  .logo-icon { width: 40px; height: 40px; font-size: 18px; }
  .logo-text { font-size: 1.1rem; }
  .logo-subtitle { display: none; }
  .form-panel { padding: 16px; }
  .progress-section { margin-bottom: 24px; }
  .step-circle { width: 36px; height: 36px; font-size: 0.875rem; }
  .field-grid { grid-template-columns: 1fr; gap: 16px; }
  .form-actions { margin-top: 24px; padding-top: 16px; }
  .generate-actions { flex-direction: column; gap: 8px; }
}
