/* BidIQ App Styles — matching landing page design language */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --navy: #0a1628;
  --deep: #111d33;
  --accent: #00d4aa;
  --accent-dim: #00b894;
  --gold: #f5c542;
  --slate: #8899aa;
  --light: #c8d6e5;
  --white: #f0f4f8;
  --danger: #e74c3c;
  --card-bg: rgba(17, 29, 51, 0.8);
  --card-border: rgba(136, 153, 170, 0.1);
  --input-bg: rgba(10, 22, 40, 0.8);
  --input-border: rgba(136, 153, 170, 0.2);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--navy);
  color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

/* ---- LAYOUT ---- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--deep);
  border-right: 1px solid var(--card-border);
  padding: 24px 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  padding: 0 24px;
  margin-bottom: 8px;
}

.sidebar-brand span { color: var(--accent); }

.sidebar-tagline {
  font-size: 0.75rem;
  color: var(--slate);
  padding: 0 24px;
  margin-bottom: 32px;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  color: var(--slate);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.nav-item:hover {
  color: var(--white);
  background: rgba(0, 212, 170, 0.05);
}

.nav-item.active {
  color: var(--accent);
  background: rgba(0, 212, 170, 0.08);
  border-right: 2px solid var(--accent);
}

.nav-item .icon { font-size: 1.1rem; width: 24px; text-align: center; }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--card-border);
}

.user-info {
  font-size: 0.8rem;
  color: var(--slate);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  font-size: 0.8rem;
  color: var(--slate);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}
.btn-logout:hover { color: var(--danger); }

.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 32px;
  max-width: 1200px;
}

/* ---- AUTH SCREENS ---- */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--deep);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 48px 40px;
}

.auth-box .brand {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.auth-box .brand span { color: var(--accent); }

.auth-subtitle {
  text-align: center;
  color: var(--slate);
  font-size: 0.9rem;
  margin-bottom: 32px;
}

/* ---- FORMS ---- */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--light);
  margin-bottom: 6px;
}

.form-group label .required { color: var(--accent); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--white);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: rgba(136, 153, 170, 0.5);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238899aa' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-select option { background: var(--deep); color: var(--white); }

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--slate);
  margin-top: 4px;
}

/* Checkbox group */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.checkbox-item:hover { border-color: var(--accent); }
.checkbox-item.checked {
  border-color: var(--accent);
  background: rgba(0, 212, 170, 0.08);
}

.checkbox-item input { display: none; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--navy);
}
.btn-primary:hover { background: var(--accent-dim); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: rgba(136, 153, 170, 0.15);
  color: var(--white);
  border: 1px solid var(--card-border);
}
.btn-secondary:hover { background: rgba(136, 153, 170, 0.25); }

.btn-gold {
  background: var(--gold);
  color: var(--navy);
}
.btn-gold:hover { background: #e6b835; }

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: rgba(0, 212, 170, 0.08); }

.btn-danger {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger);
  border: 1px solid rgba(231, 76, 60, 0.2);
}
.btn-danger:hover { background: rgba(231, 76, 60, 0.25); }

.btn-sm { padding: 8px 16px; font-size: 0.82rem; }
.btn-block { width: 100%; }

.btn-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ---- CARDS ---- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
}

/* ---- STATS ROW ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
}

.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--slate);
  margin-top: 6px;
}

.stat-card.gold .stat-value { color: var(--gold); }

/* ---- CONTRACT CARD ---- */
.contract-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contract-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.15s;
}

.contract-card:hover {
  border-color: rgba(0, 212, 170, 0.3);
  transform: translateY(-1px);
}

.contract-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.contract-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  flex: 1;
}

.fit-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.fit-excellent { background: rgba(0, 212, 170, 0.15); color: var(--accent); border: 1px solid rgba(0, 212, 170, 0.3); }
.fit-good { background: rgba(78, 205, 196, 0.15); color: #4ecdc4; border: 1px solid rgba(78, 205, 196, 0.3); }
.fit-possible { background: rgba(245, 197, 66, 0.15); color: var(--gold); border: 1px solid rgba(245, 197, 66, 0.3); }
.fit-low { background: rgba(136, 153, 170, 0.1); color: var(--slate); border: 1px solid rgba(136, 153, 170, 0.2); }

.contract-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--slate);
}

.contract-meta-item { display: flex; align-items: center; gap: 4px; }
.contract-meta-item .icon { font-size: 0.9rem; }

.contract-description {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--light);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.contract-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* ---- SCORE BREAKDOWN ---- */
.score-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.score-row-label {
  font-size: 0.82rem;
  color: var(--slate);
  width: 140px;
  flex-shrink: 0;
}

.score-bar {
  flex: 1;
  height: 8px;
  background: rgba(136, 153, 170, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width 0.5s ease;
}

.score-row-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  width: 40px;
  text-align: right;
}

/* ---- PROPOSAL VIEW ---- */
.proposal-content {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 32px;
  line-height: 1.7;
  font-size: 0.95rem;
  color: var(--light);
  white-space: pre-wrap;
}

.proposal-content h1, .proposal-content h2, .proposal-content h3 {
  color: var(--white);
  margin-top: 24px;
  margin-bottom: 12px;
}

.proposal-content h1 { font-size: 1.5rem; }
.proposal-content h2 { font-size: 1.2rem; color: var(--accent); }
.proposal-content h3 { font-size: 1.05rem; }

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-title {
  font-size: 1.8rem;
  font-weight: 700;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--slate);
  margin-top: 4px;
}

/* ---- WIZARD ---- */
.wizard-steps {
  display: flex;
  gap: 0;
  margin-bottom: 40px;
}

.wizard-step {
  flex: 1;
  padding: 16px;
  text-align: center;
  position: relative;
}

.wizard-step::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(136, 153, 170, 0.15);
}

.wizard-step.active::after { background: var(--accent); }
.wizard-step.completed::after { background: var(--accent-dim); }

.wizard-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(136, 153, 170, 0.15);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--slate);
  margin-bottom: 6px;
}

.wizard-step.active .wizard-step-number {
  background: var(--accent);
  color: var(--navy);
}
.wizard-step.completed .wizard-step-number {
  background: var(--accent-dim);
  color: var(--navy);
}

.wizard-step-label {
  font-size: 0.78rem;
  color: var(--slate);
  display: block;
}

.wizard-step.active .wizard-step-label { color: var(--accent); }

/* ---- ALERTS ---- */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.alert-error {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

.alert-success {
  background: rgba(0, 212, 170, 0.1);
  border: 1px solid rgba(0, 212, 170, 0.2);
  color: var(--accent);
}

.alert-info {
  background: rgba(245, 197, 66, 0.1);
  border: 1px solid rgba(245, 197, 66, 0.2);
  color: var(--gold);
}

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state .icon { font-size: 3rem; margin-bottom: 16px; display: block; }

.empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--slate);
  margin-bottom: 24px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- LOADING ---- */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 12px;
  color: var(--slate);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0, 212, 170, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- TAGS ---- */
.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-green { background: rgba(0, 212, 170, 0.15); color: var(--accent); }
.tag-gold { background: rgba(245, 197, 66, 0.15); color: var(--gold); }
.tag-blue { background: rgba(78, 205, 196, 0.15); color: #4ecdc4; }
.tag-gray { background: rgba(136, 153, 170, 0.1); color: var(--slate); }

/* ---- PROPOSAL LIST ---- */
.proposal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.proposal-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.proposal-item:hover {
  border-color: rgba(0, 212, 170, 0.3);
}

/* ---- DETAIL VIEW ---- */
.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--slate);
  font-size: 0.85rem;
  cursor: pointer;
  margin-bottom: 20px;
  background: none;
  border: none;
  font-family: inherit;
}
.detail-back:hover { color: var(--accent); }

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .main-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .wizard-step-label { display: none; }
  .contract-card-header { flex-direction: column; }
}

/* ---- HIDDEN ---- */
.hidden { display: none !important; }

/* ---- MOBILE NAV ---- */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--deep);
  border-top: 1px solid var(--card-border);
  padding: 8px 0;
  z-index: 100;
}

@media (max-width: 900px) {
  .mobile-nav { display: flex; justify-content: space-around; }
  .main-content { padding-bottom: 80px; }
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  color: var(--slate);
  font-size: 0.7rem;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.mobile-nav-item .icon { font-size: 1.3rem; }
.mobile-nav-item.active { color: var(--accent); }
