/* FTPortal - Application Portal Styles */
:root {
  --campaign-accent: #1F437B;
  --campaign-accent-dark: #163157;
  --text-primary: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --border-color: #e2e8f0;
  --bg-primary: #f7fafc;
  --bg-white: #ffffff;
  --success: #38a169;
  --error: #e53e3e;
  --warning: #dd6b20;
}

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

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* Portal App Container */
.portal-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.portal-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.portal-header__left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.portal-header__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.portal-header__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Main Content */
.portal-main {
  flex: 1;
  padding: 24px;
}

.portal-container {
  max-width: 80vw;
  margin: 0 auto;
}

/* Cards */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.card__head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.card__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card__subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.card__body {
  padding: 24px;
}

.card__foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Campaign Header */
.campaign-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.campaign-header__left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.campaign-logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.campaign-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

.campaign-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Chip */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: #edf2f7;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  border-radius: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: inherit;
}

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

.btn-primary {
  background: var(--campaign-accent);
  color: white;
  border: 1px solid var(--campaign-accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--campaign-accent-dark);
}

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

.btn-outline:hover:not(:disabled) {
  background: var(--bg-primary);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.w-100 {
  width: 100%;
}

/* Form Elements */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.input,
.select,
.textarea {
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-white);
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--campaign-accent);
  box-shadow: 0 0 0 3px rgba(31, 67, 123, 0.1);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-muted);
}

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

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

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

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Stepper */
.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s;
}

.step:hover {
  background: var(--bg-primary);
}

.step .dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.step.is-active {
  color: var(--campaign-accent);
  font-weight: 500;
}

.step.is-active .dot {
  background: var(--campaign-accent);
  color: white;
}

.step.is-done .dot {
  background: var(--success);
  color: white;
}

.step.is-done .dot::after {
  content: '\2713';
}

/* Hidden attribute - ensure it works with flex/grid containers */
[hidden] {
  display: none !important;
}

/* Utility Classes */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }

.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

.link-muted {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
}

.link-muted:hover {
  color: var(--campaign-accent);
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .portal-header {
    padding: 12px 16px;
  }

  .portal-main {
    padding: 16px;
  }

  .card__body {
    padding: 16px;
  }

  .campaign-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stepper {
    flex-direction: column;
  }

  .step {
    width: 100%;
  }
}