/* ================================================================
   Portal CSS — Unified User Portal for HotelHuddle Brands
   Mobile-first responsive, dark theme, CDN-served.
   Version: 20260802a
   ================================================================ */

/* ── Portal Layout ─────────────────────────────────────────── */
.portal {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}
.portal-header {
  margin-bottom: 1.5rem;
}
.portal-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
}
.portal-subtitle {
  color: var(--text-3, #a8b0c4);
  font-size: 0.9375rem;
  margin: 0;
}
.section-title {
  font-size: 1.125rem;
  margin: 1.5rem 0 0.75rem;
}

/* ── Stats Cards ────────────────────────────────────────────── */
.portal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}
.stat-card {
  background: var(--bg-2, #1a1f2e);
  border: 1px solid var(--border, #2a3040);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: border-color 0.2s;
}
.stat-card:hover {
  border-color: var(--accent, #6ba3e0);
}
.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent, #6ba3e0);
  line-height: 1.2;
}
.stat-label {
  font-size: 0.8125rem;
  color: var(--text-3, #a8b0c4);
  margin-top: 0.25rem;
}
.stat-active .stat-number {
  color: #f0a040;
}
.stat-accepted .stat-number {
  color: #4caf50;
}

/* ── Portal Actions ─────────────────────────────────────────── */
.portal-actions {
  display: flex;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

/* ── RFP Table ──────────────────────────────────────────────── */
.rfp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.rfp-table {
  width: 100%;
  border-collapse: collapse;
}
.rfp-table th {
  text-align: left;
  padding: 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3, #a8b0c4);
  border-bottom: 1px solid var(--border, #2a3040);
  white-space: nowrap;
}
.rfp-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border, #2a3040);
  font-size: 0.875rem;
  vertical-align: middle;
}
.rfp-row {
  cursor: pointer;
  transition: background 0.15s;
}
.rfp-row:hover {
  background: rgba(107, 163, 224, 0.05);
}
.rfp-name {
  font-weight: 500;
  color: var(--text-1, #e0e4f0);
}

/* ── Type Badges ────────────────────────────────────────────── */
.type-badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.type-group {
  background: rgba(107, 163, 224, 0.15);
  color: #6ba3e0;
}
.type-nightly {
  background: rgba(240, 160, 64, 0.15);
  color: #f0a040;
}
.type-slot {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
}
.type-multi-destination {
  background: rgba(156, 39, 176, 0.15);
  color: #ce93d8;
}
.type-meeting {
  background: rgba(0, 188, 212, 0.15);
  color: #4dd0e1;
}

/* ── Status Badges ──────────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-pending,
.status-pending_payment {
  background: rgba(240, 160, 64, 0.15);
  color: #f0a040;
}
.status-submitted {
  background: rgba(107, 163, 224, 0.15);
  color: #6ba3e0;
}
.status-accepted,
.status-pickup {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
}
.status-declined {
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
}
.status-cancelled,
.status-no_match {
  background: rgba(158, 158, 158, 0.15);
  color: #9e9e9e;
}

/* ── Filter Bar ─────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
  align-items: center;
}
.filter-label {
  font-size: 0.8125rem;
  color: var(--text-3, #a8b0c4);
  font-weight: 500;
}
.filter-pill {
  display: inline-block;
  padding: 0.4em 0.85em;
  border: 1px solid var(--border, #2a3040);
  border-radius: 20px;
  font-size: 0.8125rem;
  background: transparent;
  color: var(--text-2, #c0c6d8);
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}
.filter-pill:hover {
  border-color: var(--accent, #6ba3e0);
  color: var(--text-1, #e0e4f0);
}
.filter-pill.active {
  background: var(--accent, #6ba3e0);
  color: #fff;
  border-color: var(--accent, #6ba3e0);
}

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.empty-state h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
}
.empty-state p {
  color: var(--text-3, #a8b0c4);
  margin: 0 0 1.5rem;
}

/* ── Profile ────────────────────────────────────────────────── */
.profile-card {
  background: var(--bg-2, #1a1f2e);
  border: 1px solid var(--border, #2a3040);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.profile-card h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
}
.profile-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border, #2a3040);
}
.profile-field:last-child {
  border-bottom: none;
}
.profile-label {
  color: var(--text-3, #a8b0c4);
  font-size: 0.8125rem;
  min-width: 120px;
}
.profile-value {
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}
.hint {
  color: var(--text-3, #a8b0c4);
  font-size: 0.8125rem;
  margin: 0 0 1rem;
}

/* ── Auth Method Card ───────────────────────────────────────── */
.auth-method {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-1, #0f1321);
  border-radius: 8px;
}
.auth-method-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.auth-method strong {
  display: block;
  margin-bottom: 0.15rem;
}
.auth-method .hint {
  margin: 0;
  font-size: 0.8125rem;
}
.auth-method-badge {
  margin-left: auto;
  flex-shrink: 0;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}
.auth-method-badge.active {
  background: rgba(76, 175, 80, 0.15);
  color: #4caf50;
}

/* ── Social Buttons ─────────────────────────────────────────── */
.social-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.social-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border, #2a3040);
  border-radius: 8px;
  background: var(--bg-2, #1a1f2e);
  color: var(--text-1, #e0e4f0);
  font-size: 0.875rem;
  text-decoration: none;
  opacity: 0.5;
  cursor: default;
}
.social-btn:not([disabled]):not(.disabled):hover {
  border-color: var(--accent, #6ba3e0);
}
.social-icon {
  font-weight: 700;
  font-size: 1rem;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
}
.social-icon-google {
  background: #ea4335;
  color: #fff;
}
.social-icon-facebook {
  background: #1877f2;
  color: #fff;
}
.social-icon-microsoft {
  background: #7fba00;
  color: #fff;
}
.social-icon-linkedin {
  background: #0a66c2;
  color: #fff;
}
.social-status {
  font-size: 0.75rem;
  color: var(--text-3, #a8b0c4);
  margin-left: auto;
}

/* ── Social Divider (Login Page) ────────────────────────────── */
.social-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0 1rem;
  color: var(--text-3, #a8b0c4);
  font-size: 0.75rem;
}
.social-divider::before,
.social-divider::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--border, #2a3040);
}
.social-divider span {
  padding: 0 0.75rem;
  white-space: nowrap;
}
.social-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}
.social-buttons .social-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
}

/* ── Mobile (≤768px) ────────────────────────────────────────── */
@media (max-width: 768px) {
  .portal {
    padding: 0 1rem;
    margin: 1rem auto;
  }
  .portal-header h1 {
    font-size: 1.375rem;
  }

  /* Stats cards → stacked */
  .portal-stats {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Actions → full-width stacked */
  .portal-actions {
    flex-direction: column;
  }
  .portal-actions .btn {
    width: 100%;
    text-align: center;
  }

  /* RFP table → stacked cards */
  .rfp-table thead {
    display: none;
  }
  .rfp-table tbody,
  .rfp-table tr,
  .rfp-table td {
    display: block;
  }
  .rfp-table tr {
    margin-bottom: 1rem;
    border: 1px solid var(--border, #2a3040);
    border-radius: 8px;
    padding: 1rem;
    background: var(--bg-2, #1a1f2e);
  }
  .rfp-table td {
    border: none;
    padding: 0.3rem 0;
  }
  .rfp-table td[data-label]::before {
    content: attr(data-label);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-3, #a8b0c4);
    display: block;
    margin-bottom: 0.15rem;
  }

  /* Filter bar → horizontal scroll */
  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
    gap: 0.4rem;
  }
  .filter-label {
    flex-shrink: 0;
  }
  .filter-pill {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Profile → single column */
  .profile-field {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }
  .profile-value {
    text-align: left;
  }

  /* Social grid → single column */
  .social-grid {
    grid-template-columns: 1fr;
  }

  /* Auth method → stacked */
  .auth-method {
    flex-wrap: wrap;
  }
  .auth-method-badge {
    margin-left: 0;
    margin-top: 0.5rem;
    width: 100%;
    text-align: center;
  }

  /* Social buttons on login → wrap */
  .social-buttons {
    flex-wrap: wrap;
  }
}

/* ── API Keys ──────────────────────────────────────────────── */
.key-reveal-card {
  background: var(--bg-2, #1a1f2e);
  border: 2px solid var(--accent, #6ba3e0);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.key-reveal-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.key-reveal-card h3 {
  margin: 0 0 0.5rem;
}
.key-reveal-value {
  background: var(--bg-1, #0f1321);
  border: 1px solid var(--border, #2a3040);
  border-radius: 8px;
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.8125rem;
  word-break: break-all;
  color: var(--accent, #6ba3e0);
  margin: 1rem 0;
  user-select: all;
}
.key-reveal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}
.btn-copied {
  background: #4caf50 !important;
  border-color: #4caf50 !important;
}

/* Key list */
.api-key-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.api-key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg-1, #0f1321);
  border: 1px solid var(--border, #2a3040);
  border-radius: 8px;
  gap: 1rem;
}
.api-key-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.api-key-name {
  font-weight: 600;
  font-size: 0.9375rem;
}
.api-key-prefix {
  font-family: 'Courier New', monospace;
  font-size: 0.8125rem;
  color: var(--text-3, #a8b0c4);
  background: var(--bg-2, #1a1f2e);
  padding: 0.15em 0.5em;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
}
.api-key-meta {
  font-size: 0.75rem;
  color: var(--text-3, #a8b0c4);
}
.api-key-delete {
  flex-shrink: 0;
}
.btn-danger-outline {
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(244,67,54,0.4);
  border-radius: 6px;
  background: transparent;
  color: #f44336;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.15s;
}
.btn-danger-outline:hover {
  background: rgba(244,67,54,0.1);
  border-color: #f44336;
}

/* Key count badge */
.key-count {
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--text-3, #a8b0c4);
}

/* API key form */
.api-key-form .form-group {
  margin-bottom: 1rem;
}
.api-key-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.api-key-form input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border, #2a3040);
  border-radius: 6px;
  background: var(--bg-1, #0f1321);
  color: var(--text-1, #e0e4f0);
  font-size: 0.9375rem;
}
.api-key-form input[type="text"]:focus {
  border-color: var(--accent, #6ba3e0);
  outline: none;
}

/* Terms scroll box */
.terms-box {
  border: 1px solid var(--border, #2a3040);
  border-radius: 8px;
  overflow: hidden;
}
.terms-box h4 {
  margin: 0;
  padding: 0.75rem 1rem;
  background: var(--bg-1, #0f1321);
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border, #2a3040);
}
.terms-scroll {
  max-height: 200px;
  overflow-y: auto;
  padding: 1rem;
  font-size: 0.8125rem;
  color: var(--text-2, #c0c6d8);
  line-height: 1.6;
}
.terms-scroll ol {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}
.terms-scroll li {
  margin-bottom: 0.5rem;
}

/* Checkbox */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.checkbox input[type="checkbox"] {
  margin-top: 0.15rem;
  flex-shrink: 0;
}
.checkbox label {
  font-size: 0.8125rem;
  color: var(--text-2, #c0c6d8);
}

/* Error / success banners */
.error-banner {
  background: rgba(244,67,54,0.1);
  border: 1px solid rgba(244,67,54,0.3);
  color: #f44336;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.success-banner {
  background: rgba(76,175,80,0.1);
  border: 1px solid rgba(76,175,80,0.3);
  color: #4caf50;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

/* Usage placeholder */
.usage-placeholder {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.usage-stat {
  text-align: center;
  padding: 1rem;
  background: var(--bg-1, #0f1321);
  border-radius: 8px;
}
.usage-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent, #6ba3e0);
}
.usage-label {
  font-size: 0.75rem;
  color: var(--text-3, #a8b0c4);
}

/* Mobile */
@media (max-width: 768px) {
  .key-reveal-value {
    font-size: 0.6875rem;
  }
  .api-key-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .api-key-delete {
    align-self: flex-end;
  }
  .usage-placeholder {
    grid-template-columns: 1fr;
  }
  .key-reveal-actions {
    flex-direction: column;
  }
  .key-reveal-actions .btn {
    width: 100%;
  }
}


/* ── Auth Page Layout Fix ─────────────────────────────────── */
.right-panel {
  position: absolute;
  right: 0;
  top: 0;
  width: 50%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
@media (max-width: 768px) {
  .right-panel {
    position: static;
    width: 100%;
    min-height: auto;
    padding: 1rem;
  }
}

/* ── RFP Submit Page ───────────────────────────────────────── */
.rfp-card h1 {
  margin-bottom: 0.5rem;
}
.rfp-card .sub {
  color: var(--text-3, #a8b0c4);
  margin-bottom: 1.5rem;
}
.hotel-count {
  background: var(--surface, rgba(30,58,95,.15));
  border: 1px solid var(--border, #2a3040);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}
.hotel-count strong {
  color: var(--accent, #6ba3e0);
}
.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border, #2a3040);
}
.summary-item .label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3, #a8b0c4);
  display: block;
  margin-bottom: 0.15rem;
}
.summary-item .val {
  font-weight: 600;
  font-size: 0.9375rem;
}
.rfp-form {
  margin-top: 1.5rem;
}
.rfp-form .form-group {
  margin-bottom: 1.25rem;
}
.rfp-form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2, #c0c6d8);
  margin-bottom: 0.35rem;
}
.rfp-form input[type="text"],
.rfp-form input[type="email"],
.rfp-form input[type="tel"],
.rfp-form input[type="number"],
.rfp-form select,
.rfp-form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border, #2a3040);
  border-radius: 8px;
  background: var(--bg-1, #0f1321);
  color: var(--text-1, #e0e4f0);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.rfp-form input:focus,
.rfp-form select:focus,
.rfp-form textarea:focus {
  border-color: var(--accent, #6ba3e0);
  outline: none;
}
.rfp-form textarea {
  min-height: 80px;
  resize: vertical;
}
.rfp-form select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a8b0c4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}
.input-disabled {
  opacity: 0.6;
  cursor: default;
  background: var(--bg-2, #1a1f2e) !important;
}
.rfp-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.rfp-form .btn-submit {
  width: 100%;
  padding: 0.85rem;
  background: var(--accent, #6ba3e0);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 0.5rem;
}
.rfp-form .btn-submit:hover {
  background: var(--accent-light, #5a92d0);
}
.error {
  background: rgba(244,67,54,0.1);
  border: 1px solid rgba(244,67,54,0.3);
  color: #f44336;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

@media (max-width: 768px) {
  .rfp-form .form-row {
    grid-template-columns: 1fr;
  }
  .summary {
    gap: 0.5rem 1rem;
  }
}
