/* ============================================
   BlineCo Portal — register / login / dashboard / create-project
   Layered on top of styles.css
   ============================================ */

.portal-shell {
  background: var(--bg-light);
  padding: 64px 0 96px;
  min-height: calc(100vh - 200px);
}

.portal-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 40px;
}

.portal-card--wide { max-width: 1040px; }

.portal-header {
  margin-bottom: 28px;
}
.portal-header h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.portal-header p { color: var(--text-light); margin-top: 8px; }

.portal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.portal-tab {
  flex: 1 1 0;
  min-width: 140px;
  padding: 14px 16px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}
.portal-tab small {
  display: block;
  font-weight: 400;
  color: var(--text-light);
  margin-top: 4px;
  font-size: 12px;
}
.portal-tab:hover { border-color: var(--accent); }
.portal-tab[aria-pressed="true"] {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--primary);
}

.portal-form { display: grid; gap: 20px; }

.portal-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 16px;
  background: var(--bg);
}
.portal-fieldset legend {
  padding: 0 8px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

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

.portal-field { display: grid; gap: 6px; }
.portal-field--full { grid-column: 1 / -1; }

.portal-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.portal-field .hint {
  font-size: 12px;
  color: var(--text-light);
}
.portal-field input,
.portal-field select,
.portal-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  transition: border-color var(--transition);
}
.portal-field input:focus,
.portal-field select:focus,
.portal-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.portal-field textarea { min-height: 96px; resize: vertical; }

.portal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.portal-alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  border: 1px solid;
  display: none;
}
.portal-alert.is-visible { display: block; }
.portal-alert--error  { background: #fbecec; border-color: #e7b6b6; color: #7a1f1f; }
.portal-alert--success { background: var(--accent-light); border-color: var(--accent); color: var(--primary); }
.portal-alert--info   { background: #eef2f7; border-color: #c8d3e0; color: #1f3450; }

.role-only { display: none; }
.role-only.is-active { display: grid; }

/* Dashboard */
.portal-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
}
@media (max-width: 800px) { .portal-grid-2 { grid-template-columns: 1fr; } }

.project-list { display: grid; gap: 12px; }
.project-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 16px;
}
.project-card strong { display: block; font-size: 15px; color: var(--primary); }
.project-card small { color: var(--text-light); font-size: 12px; }
.project-card .status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.empty-state {
  padding: 32px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-light);
}
.empty-state h3 { color: var(--primary); margin-bottom: 8px; }

.aside-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.aside-card h3 { margin-bottom: 12px; }
.aside-card ul { list-style: none; display: grid; gap: 8px; }
.aside-card li { padding-left: 18px; position: relative; color: var(--text-light); font-size: 14px; }
.aside-card li::before { content: '→'; position: absolute; left: 0; color: var(--accent); }

/* Product chips on create-project */
.product-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.product-chip {
  position: relative;
}
.product-chip input { position: absolute; opacity: 0; pointer-events: none; }
.product-chip span {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition);
}
.product-chip input:checked + span {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--primary);
}
.product-chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Configurator iframe wrapper */
.kh-frame {
  width: 100%;
  height: 720px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-light);
}

.kh-frame-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--primary);
  color: var(--text-inverse);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  font-size: 13px;
}
.kh-frame-toolbar select {
  padding: 6px 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-family: inherit;
  font-size: 13px;
}
.kh-frame-toolbar select option { color: var(--text); }
/* Configurator states must remain mutually exclusive, including flex panels. */
#khAnonState[hidden], #khNoProjectState[hidden], #khLiveState[hidden], #khErrorState[hidden] { display: none !important; }
#khErrorState a[hidden], #features[hidden], #features + section[hidden] { display: none !important; }
.bline-site .configurator-section h1 { color: #fff; }
.bline-site .configurator-placeholder h2 { color: #fff; }
.bline-site .configurator-placeholder p { color: #f4f3ec; }
.bline-site .configurator-placeholder .btn-outline { color: #fff; border-color: #fff; }

.portal-fieldset,.portal-fieldset>*{min-width:0;max-width:100%}.portal-actions{flex-wrap:wrap}.portal-actions>*{max-width:100%;white-space:normal}@media(max-width:480px){.portal-fieldset{padding:16px}.portal-form-grid{grid-template-columns:minmax(0,1fr)}.portal-actions{align-items:stretch;flex-direction:column}.portal-actions .btn{width:100%;text-align:center}}

.portal-card #contact-form{display:grid;gap:18px}.portal-card #contact-form label{display:grid;gap:8px}.portal-card #contact-form input:not([type=checkbox]),.portal-card #contact-form textarea{width:100%;min-width:0;padding:12px;border:1px solid #aebcad;border-radius:4px;font:inherit;box-sizing:border-box}.portal-card #contact-form textarea{min-height:110px;resize:vertical}.portal-card #contact-form .check{display:flex;flex-wrap:wrap;align-items:center}.portal-card #contact-form [role=status]{margin:0}

@media(max-width:480px){.portal-card{padding:20px}}
