/* ===================================================================
   Property Wharf - User Access Portal Stylesheet
   Inherits core tokens from css/index.css and css/landing.css
   =================================================================== */

.portal-page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* Hero Section */
.portal-hero {
  padding: 56px 24px 32px 24px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.portal-user-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 32px;
}

.user-identity-box {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-avatar-emblem {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(0, 229, 176, 0.15), rgba(56, 189, 248, 0.15));
  border: 1px solid rgba(0, 229, 176, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-teal);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  box-shadow: var(--shadow-glow-teal);
}

.user-meta-block h1 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  letter-spacing: -0.02em;
}

.user-meta-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-tag {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.portal-tag.org {
  color: var(--accent-blue);
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.25);
}

.portal-denied-banner {
  width: 100%;
  margin-bottom: 24px;
  padding: 12px 18px;
  font-size: 13px;
  color: var(--accent-coral);
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.35);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.btn-portal-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  font-family: var(--font-main);
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-portal-action:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
  background: var(--bg-card);
}

.btn-portal-signout:hover {
  color: var(--accent-coral);
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.08);
}

/* Gateway Access Card */
.portal-main-container {
  max-width: 1100px;
  margin: 0 auto 60px auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.gateway-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* Status-dependent accents */
.gateway-card.authorized {
  border-color: rgba(0, 229, 176, 0.35);
  background: linear-gradient(180deg, rgba(10, 22, 38, 0.95) 0%, rgba(6, 13, 23, 0.98) 100%);
}

.gateway-card.authorized::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-teal), transparent);
}

.gateway-card.restricted {
  border-color: rgba(251, 113, 133, 0.35);
  background: linear-gradient(180deg, rgba(20, 14, 24, 0.95) 0%, rgba(6, 13, 23, 0.98) 100%);
}

.gateway-card.restricted::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-coral), transparent);
}

.gateway-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  margin-bottom: 20px;
}

.gateway-status-pill.granted {
  background: rgba(0, 229, 176, 0.12);
  color: var(--accent-teal);
  border: 1px solid rgba(0, 229, 176, 0.3);
}

.gateway-status-pill.denied {
  background: rgba(251, 113, 133, 0.12);
  color: var(--accent-coral);
  border: 1px solid rgba(251, 113, 133, 0.3);
}

.gateway-heading {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
}

.gateway-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 720px;
  margin: 0 0 28px 0;
}

.gateway-action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-launch-app {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  background: var(--accent-teal);
  color: #060d17;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 20px rgba(0, 229, 176, 0.35);
  transition: all var(--transition-normal);
}

.btn-launch-app:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 229, 176, 0.5);
  background: #1affc4;
}

.btn-launch-locked {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid var(--border-color);
  cursor: not-allowed;
}

.btn-contact-admin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-contact-admin:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-gold);
}

/* Feature Modules Preview (Authorized View) */
.modules-preview-section {
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.modules-preview-title {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.module-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition-fast);
}

.module-card-item:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.module-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-teal);
}

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

.module-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Restricted Guidance Box */
.restricted-notice-box {
  margin-top: 28px;
  padding: 20px 24px;
  border-radius: var(--radius-sm);
  background: rgba(251, 113, 133, 0.06);
  border: 1px solid rgba(251, 113, 133, 0.2);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.restricted-icon-wrap {
  color: var(--accent-coral);
  flex-shrink: 0;
  margin-top: 2px;
}

.restricted-text h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.restricted-text p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Account Details Card */
.account-specs-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px 32px;
}

.specs-header {
  font-size: 14px;
  font-family: var(--font-mono);
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.spec-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spec-label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

.spec-value.highlight-green {
  color: var(--accent-teal);
}

.spec-value.highlight-red {
  color: var(--accent-coral);
}

/* ===================================================================
   LIGHT THEME ADAPTATIONS
   Comprehensive light mode support for user access portal & gateway
   =================================================================== */
[data-theme="light"] .portal-denied-banner {
  color: #be123c;
  background: rgba(225, 29, 72, 0.06);
  border-color: rgba(225, 29, 72, 0.28);
}

[data-theme="light"] .user-avatar-emblem {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.12), rgba(2, 132, 199, 0.12));
  border-color: rgba(13, 148, 136, 0.35);
  color: #0d9488;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.12);
}

[data-theme="light"] .portal-tag {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

[data-theme="light"] .portal-tag.org {
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.25);
  color: #0284c7;
}

[data-theme="light"] .btn-portal-action {
  background: #ffffff;
  color: #334155;
  border-color: #cbd5e1;
}

[data-theme="light"] .btn-portal-action:hover {
  color: #0f172a;
  border-color: #94a3b8;
  background: #f8fafc;
}

[data-theme="light"] .btn-portal-signout:hover {
  color: #e11d48;
  border-color: rgba(225, 29, 72, 0.35);
  background: rgba(225, 29, 72, 0.06);
}

[data-theme="light"] .gateway-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .gateway-card.authorized {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-color: rgba(13, 148, 136, 0.35);
  box-shadow: 0 12px 32px rgba(13, 148, 136, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .gateway-card.authorized::before {
  background: linear-gradient(90deg, transparent, #0d9488, transparent);
}

[data-theme="light"] .gateway-card.restricted {
  background: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%);
  border-color: rgba(225, 29, 72, 0.35);
  box-shadow: 0 12px 32px rgba(225, 29, 72, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .gateway-card.restricted::before {
  background: linear-gradient(90deg, transparent, #e11d48, transparent);
}

[data-theme="light"] .gateway-status-pill.granted {
  background: rgba(13, 148, 136, 0.08);
  color: #0f766e;
  border-color: rgba(13, 148, 136, 0.3);
}

[data-theme="light"] .gateway-status-pill.denied {
  background: rgba(225, 29, 72, 0.08);
  color: #be123c;
  border-color: rgba(225, 29, 72, 0.28);
}

[data-theme="light"] .gateway-heading {
  color: #0f172a;
}

[data-theme="light"] .gateway-desc {
  color: #334155;
}

[data-theme="light"] .btn-launch-app {
  background: #0d9488;
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(13, 148, 136, 0.3);
}

[data-theme="light"] .btn-launch-app:hover {
  background: #0f766e;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.42);
}

[data-theme="light"] .btn-launch-locked {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

[data-theme="light"] .btn-contact-admin {
  background: rgba(217, 119, 6, 0.08);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.3);
}

[data-theme="light"] .btn-contact-admin:hover {
  background: rgba(217, 119, 6, 0.16);
  border-color: #d97706;
}

[data-theme="light"] .modules-preview-section {
  border-top-color: #e2e8f0;
}

[data-theme="light"] .modules-preview-title {
  color: #64748b;
}

[data-theme="light"] .module-card-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .module-card-item:hover {
  background: #ffffff;
  border-color: var(--accent-teal);
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.12);
  transform: translateY(-2px);
}

[data-theme="light"] .module-icon-wrap {
  background: rgba(13, 148, 136, 0.08);
  border-color: rgba(13, 148, 136, 0.22);
  color: #0d9488;
}

[data-theme="light"] .module-title {
  color: #0f172a;
}

[data-theme="light"] .module-desc {
  color: #475569;
}

[data-theme="light"] .restricted-notice-box {
  background: rgba(225, 29, 72, 0.04);
  border-color: rgba(225, 29, 72, 0.2);
}

[data-theme="light"] .restricted-icon-wrap {
  color: #e11d48;
}

[data-theme="light"] .restricted-text h4 {
  color: #0f172a;
}

[data-theme="light"] .restricted-text p {
  color: #334155;
}

[data-theme="light"] .account-specs-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .specs-header {
  color: #b45309;
}

[data-theme="light"] .spec-label {
  color: #64748b;
}

[data-theme="light"] .spec-value {
  color: #0f172a;
}

[data-theme="light"] .spec-value.highlight-green {
  color: #0d9488;
}

[data-theme="light"] .spec-value.highlight-red {
  color: #e11d48;
}

@media (max-width: 768px) {
  .portal-user-strip {
    flex-direction: column;
    align-items: flex-start;
  }
  .gateway-card {
    padding: 24px;
  }
  .gateway-heading {
    font-size: 24px;
  }
  .modules-grid {
    grid-template-columns: 1fr;
  }
}
