/* ============================================================
   Plyvo app page stylesheet — app.soltecsol.com (index.html)
   Phase 2 item 2, slice 1. Loaded ONLY by index.html.
   Design language: navy #0b1220, ice-cyan #22d3ee, violet #7c3aed,
   Space Grotesk headlines, glow cards, generous spacing.
   All JS show/hide contracts preserved (see rules marked CONTRACT).
   ============================================================ */

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

:root {
  --navy: #0b1220;
  --navy-2: #0f1a30;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(148, 163, 184, 0.16);
  --cyan: #22d3ee;
  --violet: #7c3aed;
  --violet-soft: #a78bfa;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --danger: #f87171;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--navy);
  background-image:
    radial-gradient(900px 500px at 15% -5%, rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(900px 600px at 85% 10%, rgba(124, 58, 237, 0.14), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(34, 211, 238, 0.07), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---------- floating background orbs ---------- */

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-28px); }
}

.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.floating-element {
  position: absolute;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
  animation: float 22s infinite ease-in-out;
}

.floating-element:nth-child(1) {
  top: 8%;
  left: -6%;
  background: var(--cyan);
}

.floating-element:nth-child(2) {
  top: 45%;
  right: -8%;
  background: var(--violet);
  animation-delay: -7s;
}

.floating-element:nth-child(3) {
  bottom: -10%;
  left: 30%;
  background: var(--violet-soft);
  animation-delay: -14s;
  opacity: 0.10;
}

/* ---------- top navigation ---------- */

.top-navigation {
  position: relative;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 22px clamp(16px, 4vw, 48px);
  width: 100%;
}

.language-selector-container {
  position: relative;
  margin-left: 0;
}

.language-selector {
  position: relative;
}

.language-toggle-button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.language-toggle-button:hover {
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.45);
}

.language-dropdown-arrow {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* CONTRACT: hidden by default; JS toggles inline display and .show */
.language-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 230px;
  max-height: 65vh;
  overflow-y: auto;
  background: rgba(15, 26, 48, 0.97);
  backdrop-filter: blur(14px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.language-dropdown.show {
  display: block;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  transition: background-color 0.15s ease;
}

.language-option:hover {
  background: rgba(34, 211, 238, 0.10);
}

.signin-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #ffffff;
  border: none;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.signin-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.35);
}

/* CONTRACT: logout hidden at load; JS swaps Sign In / Logout after auth check */
#logoutButton {
  display: none;
}

/* ---------- header ---------- */

.header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(28px, 5vw, 56px) 20px clamp(40px, 6vw, 72px) 20px;
}

.company-name {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.logo {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  background: linear-gradient(100deg, #ffffff 20%, var(--cyan) 55%, var(--violet-soft) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--cyan);
}

.tagline {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: var(--text);
  margin-bottom: 14px;
  font-weight: 600;
}

.subtitle {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ---------- layout shell ---------- */

.container {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 32px);
}

.main-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

/* ---------- generator card ---------- */

.generator-section {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: clamp(24px, 4vw, 48px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  margin-bottom: 48px;
}

.section-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(1.4rem, 2.5vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 34px;
  color: #ffffff;
}

/* ---------- responsive form grid ----------
   Direct children of #descriptionForm:
   1 product identification | 2 brand tone | 3 length
   4 language | 5 audience | 6 key features | submit button.
   Columns collapse automatically at ANY width; nothing can overlap. */

#descriptionForm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 26px 30px;
  align-items: start;
}

#descriptionForm > .form-group {
  margin-bottom: 0;
  min-width: 0;
}

#descriptionForm > .form-group:nth-child(1),
#descriptionForm > .form-group:nth-child(6),
#descriptionForm > .btn-primary {
  grid-column: 1 / -1;
}

.form-group {
  margin-bottom: 25px;
  min-width: 0;
}

.form-label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-width: 0;
  padding: 15px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  color: #ffffff;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
  background: rgba(255, 255, 255, 0.07);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.form-select {
  cursor: pointer;
}

.form-select option {
  background: var(--navy-2);
  color: #ffffff;
}

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

/* ---------- input method selector ---------- */

.input-method-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.method-btn {
  flex: 1 1 150px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.method-btn:hover {
  border-color: rgba(34, 211, 238, 0.45);
  color: var(--text);
}

/* CONTRACT: JS toggles .active between the three method buttons */
.method-btn.active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(124, 58, 237, 0.18));
  border-color: rgba(34, 211, 238, 0.6);
  color: #ffffff;
}

/* CONTRACT: input groups hidden unless .active */
.input-group {
  display: none;
  margin-bottom: 6px;
}

.input-group.active {
  display: block;
}

.barcode-lookup-btn {
  margin-top: 12px;
  background: rgba(34, 211, 238, 0.10);
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: var(--cyan);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.barcode-lookup-btn:hover {
  background: rgba(34, 211, 238, 0.2);
  color: #ffffff;
}

/* ---------- product preview ---------- */

.product-preview {
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
}

/* CONTRACT: JS removes this class to reveal the preview */
.product-preview-hidden {
  display: none !important;
}

.preview-content {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.preview-image img,
.product-preview img {
  max-width: 110px;
  max-height: 110px;
  width: auto;
  height: auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.preview-details {
  min-width: 0;
  flex: 1 1 220px;
}

.product-preview h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.05rem;
  color: #ffffff;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.product-preview p {
  font-size: 0.9rem;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

/* ---------- usage tracker ---------- */

.usage-tracker {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 30px;
}

.usage-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.usage-counter {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 12px;
}

/* CONTRACT: steady red counter while remaining generations are low */
.usage-counter.usage-warning {
  color: #ef4444;
}

.usage-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

/* CONTRACT: JS sets the width inline */
.usage-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transition: width 0.3s ease;
}

.usage-footer {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.upgrade-link {
  color: var(--cyan);
  text-decoration: none;
}

.upgrade-link:hover {
  text-decoration: underline;
}

/* ---------- primary button ---------- */

.btn-primary {
  display: block;
  width: 100%;
  max-width: 460px;
  margin: 14px auto 0 auto;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #ffffff;
  border: none;
  padding: 17px 36px;
  border-radius: 999px;
  font-size: 1.08rem;
  font-weight: 700;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(34, 211, 238, 0.4);
}

/* CONTRACT: JS disables form controls during generation / lock */
#descriptionForm button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---------- results ---------- */

.results {
  margin-top: 36px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 20px;
  padding: clamp(20px, 3vw, 32px);
  box-shadow: 0 16px 48px rgba(34, 211, 238, 0.08);
}

/* CONTRACT: JS removes this class to reveal results */
.results-hidden {
  display: none !important;
}

.results h3 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.25rem;
  color: #ffffff;
  margin-bottom: 18px;
}

.results-content {
  color: var(--text);
  line-height: 1.85;
  font-size: 1rem;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.copy-button {
  margin-top: 22px;
}

/* ---------- popups (trial exhausted + subscriber near-limit) ---------- */

/* CONTRACT: hidden by default; JS toggles .visible */
.trial-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 8, 18, 0.75);
  backdrop-filter: blur(6px);
  z-index: 9000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.trial-popup-overlay.visible {
  display: flex;
}

.trial-popup {
  background: linear-gradient(150deg, #101a30 0%, #17123a 100%);
  border: 1px solid rgba(34, 211, 238, 0.3);
  border-radius: 20px;
  padding: clamp(24px, 4vw, 40px);
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.trial-popup h3 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.3rem;
  color: #ffffff;
  margin-bottom: 14px;
}

.trial-popup p {
  color: var(--text-dim);
  margin-bottom: 24px;
  line-height: 1.7;
}

.trial-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.trial-popup-yes {
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #ffffff;
  border: none;
  padding: 13px 28px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trial-popup-yes:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.35);
}

.trial-popup-no {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--card-border);
  padding: 13px 28px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.trial-popup-no:hover {
  border-color: rgba(148, 163, 184, 0.5);
}

/* CONTRACT: Contact us hidden by default; JS reveals it for Enterprise */
#subPopupContact {
  display: none;
}

/* ---------- stats section ---------- */

.stats-section {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 32px) 56px clamp(16px, 3vw, 32px);
  text-align: center;
}

.stats-section .section-title {
  margin-bottom: 36px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
@media (max-width: 980px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-item {
    padding: 20px 12px;
  }

  .stat-number {
    font-size: 1.5rem;
  }
}

.stat-item {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 28px 18px;
  transition: border-color 0.2s ease;
}

.stat-item:hover {
  border-color: rgba(34, 211, 238, 0.4);
}

.stat-number {
  display: block;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(100deg, var(--cyan), var(--violet-soft));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--cyan);
}

.stat-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ---------- footer ---------- */

.support-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 28px 20px 40px 20px;
  color: var(--text-dim);
  font-size: 0.9rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.support-email {
  color: var(--cyan);
  text-decoration: none;
}

.support-email:hover {
  text-decoration: underline;
}

/* ---------- error messages + notification toast ---------- */

.error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 6px;
  min-height: 0;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
}

.notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 26, 48, 0.97);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: #ffffff;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 0.92rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9500;
  max-width: calc(100vw - 40px);
}

.notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- generic utility (kept for JS compatibility) ---------- */

.hidden {
  display: none !important;
}

/* ---------- phone layout (stacked, touch-friendly) ---------- */

@media (max-width: 640px) {
  .top-navigation {
    padding: 16px;
  }

  .signin-button,
  .language-toggle-button {
    min-height: 44px;
  }

  .header {
    padding: 24px 16px 36px 16px;
  }

  .company-name {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }

  .section-title {
    font-size: 1.15rem;
  }

  .generator-section {
    border-radius: 18px;
    margin-bottom: 32px;
  }

  #descriptionForm {
    gap: 22px;
  }

  .input-method-selector {
    flex-direction: column;
  }

  .method-btn {
    flex: 1 1 auto;
    width: 100%;
    min-height: 48px;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* prevents iOS auto-zoom on focus */
    min-height: 48px;
  }

  .barcode-lookup-btn {
    width: 100%;
    min-height: 48px;
  }

  .btn-primary {
    max-width: none;
    min-height: 52px;
  }

  .trial-popup-actions {
    flex-direction: column;
  }

  .trial-popup-yes,
  .trial-popup-no {
    width: 100%;
    min-height: 48px;
  }

  .stats-section .section-title {
    font-size: 1.2rem;
  }

  .stats-grid {
    gap: 12px;
  }

  .stat-item {
    padding: 16px 10px;
  }

  .stat-number {
    font-size: 1.15rem;
    margin-bottom: 4px;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .language-dropdown {
    position: fixed;
    top: 72px;
    left: 12px;
    right: 12px;
    min-width: 0;
  }
}

/* Hide the browser's built-in password reveal eye (Edge) — the app adds its own */
input[type="password"]::-ms-reveal {
  display: none;
}

/* Inline SVG icons that replaced UI emojis (cosmetic slice part 2).
   Icons sit OUTSIDE data-translate spans so language switches cannot destroy them. */
.ui-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  flex-shrink: 0;
}
/* Phone-camera barcode scanner (barcode slice Part B) */
.scan-camera-btn {
  margin-left: 10px;
}

.scanner-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.scanner-overlay.active {
  display: flex;
}

.scanner-box {
  width: min(92vw, 560px);
  text-align: center;
}

.scanner-video {
  width: 100%;
  max-height: 60vh;
  border: 1px solid rgba(34, 211, 238, 0.5);
  border-radius: 16px;
  background: #000000;
}

.scanner-hint {
  color: #ffffff;
  margin: 12px 0;
  font-size: 0.95rem;
}

.scanner-close-btn {
  background: rgba(34, 211, 238, 0.10);
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: var(--cyan);
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 640px) {
  .scan-camera-btn {
    margin-left: 0;
    width: 100%;
    min-height: 48px;
  }
}
