/* ===========================================
   IAC Portal Styles v2026.2
   Extracted from inline styles; uses design tokens
   =========================================== */

/* --- Portal Layout --- */
body.portal-body {
  background: var(--slate-100);
  margin: 0;
  font-family: var(--font-body);
}

body.portal-auth-body {
  background: var(--slate-50);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--navy);
  color: var(--text-inverse);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar-logo {
  height: 32px;
  filter: brightness(0) invert(1);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.9rem;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: calc(100vh - 64px);
}

.sidebar {
  background: var(--white);
  border-right: 1px solid var(--slate-200);
  padding: 24px 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
  z-index: 10;
}

.sidebar .nav-item {
  padding: 12px 24px;
  color: var(--text-body);
  text-decoration: none;
  display: block;
  font-weight: 500;
  border-left: 4px solid transparent;
  transition: all 0.2s;
}

.sidebar .nav-item:hover,
.sidebar .nav-item.active {
  background: var(--slate-50);
  color: var(--gold-dark, #b48c36);
  border-left-color: var(--gold-dark, #b48c36);
}

.main-content {
  padding: 40px;
}

/* --- Welcome Header --- */
.welcome-header {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.welcome-header h1 {
  font-size: 2rem;
  margin: 0 0 8px 0;
  color: var(--text-heading);
}

/* --- Grid Panels --- */
.grid-panels {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 20px 0;
  border-bottom: 1px solid var(--slate-100);
  padding-bottom: 12px;
}

/* --- Award Cards --- */
.award-card {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  background: #FAFAFA;
}

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

.award-status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
}

.status-payment_pending,
.status-evidence_required,
.status-pending_review {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #fde68a;
}

.status-approved {
  background: #D1FAE5;
  color: #065F46;
  border: 1px solid #a7f3d0;
}

.status-rejected {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #fecaca;
}

/* --- Marketplace Items --- */
.marketplace-item {
  background: linear-gradient(135deg, var(--navy) 0%, #172554 100%);
  color: var(--text-inverse);
  padding: 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}

/* --- Modal Styles --- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--white);
  padding: 32px;
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  max-height: 90vh;
  overflow-y: auto;
}

/* --- Portal Forms --- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-body);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

/* --- Portal Buttons --- */
.btn {
  background: var(--navy);
  color: var(--text-inverse);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.btn:hover {
  background: var(--blue);
}

.btn.outline {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--navy);
}

.btn.outline:hover {
  background: var(--slate-100);
}

/* --- Badge Code Block --- */
.badge-code {
  display: block;
  background: #1E293B;
  color: #4ADE80;
  padding: 16px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  border-radius: var(--radius-sm);
  margin: 16px 0;
  overflow-x: auto;
  border: 1px solid #0F172A;
}

/* --- Portal Header User Area --- */
.header-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border-light);
}

.header-user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.125rem;
}

.header-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-heading);
}

.header-user-credits {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.header-logout {
  font-size: 0.8125rem;
  color: var(--error);
  text-decoration: none;
  font-weight: 500;
}

.header-logout:hover {
  text-decoration: underline;
}

/* --- Portal Auth (Login/Register) --- */
.portal-auth-container {
  max-width: 500px;
  margin: 40px auto;
  width: 100%;
  padding: 0 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  height: 48px;
  margin-bottom: 16px;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--slate-200);
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 12px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.auth-tab.active {
  color: var(--gold-dark);
  border-bottom-color: var(--gold-dark);
}

.feedback {
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.9rem;
  display: none;
}

.feedback.error {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FCA5A5;
}

.feedback.success {
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #86EFAC;
}

/* --- Wizard (Apply Page) --- */
.wizard-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 800px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
}

.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 32px;
  position: relative;
}

.step-indicator::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--slate-200);
  z-index: 1;
}

.step-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--slate-200);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  position: relative;
  z-index: 2;
  font-size: 0.85rem;
}

.step-dot.active {
  background: var(--navy-dark);
  color: var(--text-inverse);
}

.step-dot.completed {
  background: var(--gold);
  color: var(--text-inverse);
  border-color: var(--gold);
}

.wizard-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--slate-200);
}

.error-msg {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 4px;
  display: none;
}

#success-message {
  text-align: center;
  padding: 40px 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    padding: 20px;
  }

  .grid-panels {
    grid-template-columns: 1fr;
  }

  .welcome-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .header-user {
    flex-direction: column;
    align-items: stretch;
    border-left: none;
    border-top: 1px solid var(--border-light);
    margin-left: 0;
    padding-left: 0;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
  }
}
