/* Client portal shell — brand tokens from styles.css */

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--secondary-color);
  border-radius: 4px;
}

.portal-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background-light);
  padding: 2rem 1.25rem;
}

.portal-login-card {
  background: #fff;
  border: 1px solid rgba(255, 153, 193, 0.35);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 16px 40px rgba(8, 7, 5, 0.08);
}

.portal-login-card .brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  font-weight: 500;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 0.25rem;
}

.portal-login-card h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.75rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.portal-login-card .sub {
  text-align: center;
  color: rgba(8, 7, 5, 0.7);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.demo-hint {
  background: #fff;
  border: 1px solid var(--accent-color);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-dark);
}

.demo-hint strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--secondary-color);
}

.demo-hint code {
  font-family: 'Josefin Sans', sans-serif;
  background: var(--background-light);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.portal-form-group {
  margin-bottom: 1.1rem;
}

.portal-form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.portal-form-group input,
.portal-form-group select,
.portal-form-group textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 2px solid rgba(255, 153, 193, 0.45);
  border-radius: 10px;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 1rem;
  color: var(--text-dark);
  background: #fff;
}

.portal-form-group input:focus,
.portal-form-group select:focus,
.portal-form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 153, 193, 0.15);
}

.portal-form-group textarea {
  min-height: 110px;
  resize: vertical;
}

.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 999px;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

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

.portal-btn-primary {
  background: var(--primary-color);
  color: #fff;
  width: 100%;
}

.portal-btn-primary:hover:not(:disabled) {
  background: var(--secondary-color);
}

.portal-btn-secondary {
  background: var(--secondary-color);
  color: #fff;
}

.portal-btn-secondary:hover:not(:disabled) {
  background: var(--text-dark);
}

.portal-btn-ghost {
  background: transparent;
  color: var(--secondary-color);
  border: 1px solid rgba(114, 114, 171, 0.35);
}

.portal-btn-ghost:hover:not(:disabled) {
  background: var(--background-light);
}

.portal-msg {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.portal-msg.visible {
  display: block;
}

.portal-msg-error {
  background: rgba(114, 114, 171, 0.12);
  color: var(--secondary-color);
  border: 1px solid rgba(114, 114, 171, 0.35);
}

.portal-msg-success {
  background: rgba(255, 153, 193, 0.15);
  color: var(--text-dark);
  border: 1px solid rgba(255, 153, 193, 0.45);
}

.portal-back {
  text-align: center;
  margin-top: 1.25rem;
}

.portal-back a {
  color: var(--secondary-color);
  text-decoration: none;
  font-size: 0.9rem;
}

.portal-back a:hover {
  text-decoration: underline;
}

/* App shell */
.portal-app {
  display: none;
  min-height: 100vh;
  background: var(--background-light);
}

.portal-app.active {
  display: flex;
  flex-direction: column;
}

.portal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid rgba(255, 153, 193, 0.35);
  position: sticky;
  top: 0;
  z-index: 40;
}

.portal-topbar-brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 500;
}

.portal-topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.portal-topbar-meta .user-name {
  font-size: 0.9rem;
  color: rgba(8, 7, 5, 0.75);
}

.portal-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

.portal-nav {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid rgba(255, 153, 193, 0.3);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.portal-nav button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.85rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-dark);
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.92rem;
  cursor: pointer;
}

.portal-nav button i {
  width: 1.1rem;
  color: var(--secondary-color);
}

.portal-nav button.active,
.portal-nav button:hover {
  background: var(--background-light);
}

.portal-nav button.active {
  font-weight: 600;
  border: 1px solid rgba(255, 153, 193, 0.5);
}

.portal-main {
  flex: 1;
  padding: 1.5rem 1.25rem 2.5rem;
  overflow-y: auto;
}

.portal-panel {
  display: none;
  max-width: 960px;
  margin: 0 auto;
  animation: portalFade 0.35s ease;
}

.portal-panel.active {
  display: block;
}

@keyframes portalFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.portal-panel h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

.portal-panel .lead {
  color: rgba(8, 7, 5, 0.7);
  margin-bottom: 1.5rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: #fff;
  border: 1px solid rgba(255, 153, 193, 0.35);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
}

.stat-card .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--secondary-color);
  margin-bottom: 0.35rem;
}

.stat-card .value {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 600;
}

.surface {
  background: #fff;
  border: 1px solid rgba(255, 153, 193, 0.35);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.surface h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.week-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.week-filters button {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(114, 114, 171, 0.35);
  background: #fff;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-dark);
}

.week-filters button.active {
  background: var(--secondary-color);
  color: #fff;
  border-color: var(--secondary-color);
}

.video-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.video-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(255, 153, 193, 0.3);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: 'Josefin Sans', sans-serif;
  color: var(--text-dark);
}

.video-row:hover,
.video-row.selected {
  border-color: var(--primary-color);
  background: var(--background-light);
}

.video-row .meta {
  font-size: 0.8rem;
  color: rgba(8, 7, 5, 0.6);
  margin-top: 0.2rem;
}

.video-row .badge-watched {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--secondary-color);
  white-space: nowrap;
}

.work-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .work-layout {
    grid-template-columns: 1fr;
  }
}

.player-wrap video {
  width: 100%;
  border-radius: 12px;
  background: #080705;
  max-height: 360px;
}

.player-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  background: #fff;
  border: 1px dashed rgba(114, 114, 171, 0.4);
  border-radius: 12px;
  color: rgba(8, 7, 5, 0.55);
  text-align: center;
  padding: 1.5rem;
}

.stars {
  display: flex;
  gap: 0.35rem;
  margin: 0.75rem 0;
}

.stars button {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  color: rgba(114, 114, 171, 0.35);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.stars button.on {
  color: var(--primary-color);
}

.review-locked {
  opacity: 0.55;
  pointer-events: none;
}

.review-card {
  border-bottom: 1px solid rgba(255, 153, 193, 0.25);
  padding: 1rem 0;
}

.review-card:last-child {
  border-bottom: none;
}

.review-card .stars-static {
  color: var(--primary-color);
  letter-spacing: 0.1em;
  margin: 0.25rem 0;
}

.qa-thread {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.qa-item {
  border: 1px solid rgba(255, 153, 193, 0.3);
  border-radius: 12px;
  padding: 1rem;
  background: #fff;
}

.qa-item .q-label,
.qa-item .a-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--secondary-color);
  margin-bottom: 0.25rem;
}

.qa-item .answer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(203, 238, 243, 0.8);
}

.qa-item .pending {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: rgba(8, 7, 5, 0.55);
  font-style: italic;
}

.progress-list li {
  list-style: none;
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 153, 193, 0.25);
}

.progress-list li:last-child {
  border-bottom: none;
}

/* Password modal */
.portal-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 7, 5, 0.45);
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.portal-modal.open {
  display: flex;
}

.portal-modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  max-width: 420px;
  width: 100%;
}

.portal-modal-card h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

/* Nutrition (meal analyzer) nested styles */
.nutrition-wrap .upload-box {
  background: #fff;
  border: 1px solid rgba(255, 153, 193, 0.35);
  border-radius: 14px;
  padding: 1.5rem;
}

.nutrition-wrap .upload-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.nutrition-wrap .upload-option {
  border: 2px dashed rgba(255, 153, 193, 0.5);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  background: var(--background-light);
}

.nutrition-wrap .upload-option:hover {
  border-color: var(--primary-color);
}

.nutrition-wrap .upload-option i {
  font-size: 1.75rem;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.nutrition-wrap .upload-option h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.nutrition-wrap .upload-option p {
  font-size: 0.85rem;
  color: rgba(8, 7, 5, 0.65);
}

.nutrition-wrap #fileInput {
  display: none;
}

.nutrition-wrap .video-preview,
.nutrition-wrap .image-preview {
  max-width: 100%;
  border-radius: 12px;
  max-height: 320px;
}

.nutrition-wrap .camera-controls,
.nutrition-wrap .preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
}

.nutrition-wrap .macros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.nutrition-wrap .macro-card {
  background: #fff;
  border: 1px solid rgba(255, 153, 193, 0.35);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.nutrition-wrap .macro-card.highlight {
  border-color: var(--primary-color);
  background: var(--background-light);
}

.nutrition-wrap .macro-card .value {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 600;
}

.nutrition-wrap .macro-card .label {
  font-size: 0.8rem;
  color: var(--secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nutrition-wrap .results-section {
  display: none;
  margin-top: 1.25rem;
}

.nutrition-wrap .preview-section {
  display: none;
  margin-top: 1rem;
}

.nutrition-wrap .meal-info-group {
  margin: 1rem 0;
}

.nutrition-wrap .meal-info-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.nutrition-wrap .meal-info-group textarea {
  width: 100%;
  min-height: 90px;
  padding: 0.75rem;
  border: 2px solid rgba(255, 153, 193, 0.45);
  border-radius: 10px;
  font-family: 'Josefin Sans', sans-serif;
}

.mobile-nav-toggle {
  display: none;
  border: 1px solid rgba(114, 114, 171, 0.35);
  background: #fff;
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .portal-layout {
    flex-direction: column;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

  .portal-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255, 153, 193, 0.3);
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .portal-nav.open {
    display: flex;
  }

  .portal-nav button {
    width: auto;
    flex: 1 1 auto;
  }

  .nutrition-wrap .upload-options {
    grid-template-columns: 1fr;
  }
}
