/* ============================================================
   Mr SolutionAI — layout.css
   Location: /css/layout.css
   Mr Solution Tech © 2025
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');

/* ===== CUSTOM PROPERTIES ===== */
:root {
  --color-primary:              #7c3aed;
  --color-primary-hover:        #6d28d9;
  --color-primary-accent:       #a78bfa;
  --color-primary-shadow:       rgba(124, 58, 237, 0.4);
  --color-primary-shadow-hover: rgba(124, 58, 237, 0.6);
  --transition-base:  0.3s ease;
  --transition-theme: 0.5s;
  --radius-lg:  1rem;
  --radius-xl:  1.25rem;
}

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  transition: background-color var(--transition-theme), color var(--transition-theme);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== LOGO — clean: NO background, NO gradient wrapper, NO border ring, NO shadow ===== */
.logo-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .65rem;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  /* Only a gentle hover scale — no background, border, shadow */
  transition: transform .25s ease;
}
.logo-wrapper:hover { transform: scale(1.06); }

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  /* Slight enhancement so logo pops on both light and dark backgrounds */
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.12));
}
.dark .logo-img {
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.35)) brightness(1.08);
}

@media (min-width: 768px) {
  .logo-wrapper { width: 50px; height: 50px; }
}

/* ===== LOGO BRAND TEXT ===== */
.logo-brand {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
  letter-spacing: -.01em;
  display: inline-flex;
  align-items: baseline;
  user-select: none;
  white-space: nowrap;
}

/* "Mr Solution" — deep purple → violet gradient */
.logo-brand-mr-solution {
  background: linear-gradient(90deg, #7c3aed 0%, #9333ea 55%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  font-weight: 800;
}

/* "AI" — bright electric sky-blue → indigo gradient (visibly brighter than purple) */
.logo-brand-ai {
  background: linear-gradient(90deg, #38bdf8 0%, #0ea5e9 45%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  font-weight: 900;
  letter-spacing: .03em;
}

@media (min-width: 768px) {
  .logo-brand    { font-size: 1.35rem; }
}
@media (max-width: 480px) {
  .logo-brand    { font-size: 1rem; }
  .logo-wrapper  { width: 38px; height: 38px; }
}

/* ===== PRIMARY BUTTONS ===== */
.btn-primary {
  background-color: var(--color-primary);
  box-shadow: 0 5px 15px -3px var(--color-primary-shadow);
  transition: background-color var(--transition-base), transform .2s ease, box-shadow var(--transition-base);
  border: none;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}
.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -5px var(--color-primary-shadow-hover);
}
.btn-primary:active  { transform: translateY(0); }
.btn-primary:focus-visible {
  outline: 2px solid var(--color-primary-accent);
  outline-offset: 3px;
}

.dark .btn-primary {
  background-color: var(--color-primary-accent);
  box-shadow: 0 5px 15px -3px rgba(167, 139, 250, 0.4);
  color: #1f2937;
}
.dark .btn-primary:hover {
  background-color: #8b5cf6;
  box-shadow: 0 8px 20px -5px rgba(167, 139, 250, 0.6);
}

/* ===== ANIMATIONS ===== */
.hero-text {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInSlide 0.9s ease-out forwards;
}
@keyframes fadeInSlide {
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease-out forwards;
}
@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}

.feature-card {
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  animation: cardAppear 0.6s ease-out forwards;
}
@keyframes cardAppear {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.feature-card:nth-child(1) { animation-delay: .10s; }
.feature-card:nth-child(2) { animation-delay: .20s; }
.feature-card:nth-child(3) { animation-delay: .30s; }

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .hero-text, .fade-in-up, .feature-card {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ===== FAQ ===== */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease-in-out;
}
.faq-answer.open { max-height: 500px; }

.rotate-icon { transition: transform .3s ease; flex-shrink: 0; }

/* ===== TRIAL BANNER ===== */
.trial-banner {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  padding: .75rem 1rem;
  text-align: center;
  z-index: 999;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  display: none;
  animation: slideDown .35s ease-out;
}
.trial-banner.active { display: block; }

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
  margin-top: .5rem;
}
.progress-fill {
  width: 100%;
  height: 100%;
  background: white;
  transition: width 1s linear;
  border-radius: 2px;
}

/* ===== ACCESS MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  overflow-y: auto;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }

.modal-content {
  background: white;
  padding: 2rem 1.5rem;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
  animation: modalSlideIn .4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  margin: auto;
}
.dark .modal-content { background: #1f2937; }

@keyframes modalSlideIn {
  from { transform: translateY(-40px) scale(0.92); opacity: 0; }
  to   { transform: translateY(0)     scale(1);    opacity: 1; }
}

@media (max-width: 640px) {
  .modal-content {
    padding: 1.5rem 1rem;
    max-width: 96%;
    max-height: 92vh;
    overflow-y: auto;
  }
}

/* ===== MODAL INPUTS ===== */
.modal-input {
  width: 100%;
  padding: .75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: .5rem;
  font-size: 16px; /* prevent iOS auto-zoom */
  transition: all var(--transition-base);
  outline: none;
  font-family: 'Inter', sans-serif;
  background: white;
  color: #111827;
}
.modal-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.dark .modal-input {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}
.dark .modal-input:focus {
  border-color: var(--color-primary-accent);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

/* Modal action buttons (generated dynamically by JS) */
.modal-btn {
  display: block;
  width: 100%;
  padding: .75rem 1.5rem;
  border-radius: .5rem;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-base), transform .15s ease, box-shadow var(--transition-base);
  border: none;
  text-align: center;
  text-decoration: none;
}
.modal-btn-primary {
  background-color: var(--color-primary);
  color: white;
  box-shadow: 0 4px 12px -2px var(--color-primary-shadow);
}
.modal-btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
}
.dark .modal-btn-primary {
  background-color: var(--color-primary-accent);
  color: #1f2937;
}
.modal-btn-secondary {
  background: #e5e7eb;
  color: #374151;
}
.modal-btn-secondary:hover { background: #d1d5db; }
.dark .modal-btn-secondary {
  background: #374151;
  color: #e5e7eb;
}
.dark .modal-btn-secondary:hover { background: #4b5563; }

.modal-btn-ghost {
  background: none;
  color: #6b7280;
  box-shadow: none;
}
.modal-btn-ghost:hover { color: #374151; }
.dark .modal-btn-ghost:hover { color: #e5e7eb; }

/* Modal error text */
.modal-error {
  color: #ef4444;
  font-size: .875rem;
  display: none;
  margin-top: -.25rem;
}

/* ===== TOAST NOTIFICATIONS ===== */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-width: 360px;
  width: calc(100vw - 2rem);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-radius: .875rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.1);
  color: white;
  font-size: .9rem;
  font-weight: 500;
  pointer-events: all;
  border-left: 4px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  animation: toastIn .4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.toast.hiding { animation: toastOut .35s ease-in forwards; }

.toast-success { background: linear-gradient(135deg, #059669, #10b981); }
.toast-error   { background: linear-gradient(135deg, #dc2626, #ef4444); }
.toast-warning { background: linear-gradient(135deg, #d97706, #f59e0b); }
.toast-info    { background: linear-gradient(135deg, #2563eb, #3b82f6); }

.toast-icon    { flex-shrink: 0; width: 20px; height: 20px; margin-top: 1px; }
.toast-body    { flex: 1; min-width: 0; }
.toast-title   { font-weight: 700; font-size: .875rem; margin-bottom: .15rem; letter-spacing: .01em; }
.toast-message { font-size: .825rem; opacity: .92; line-height: 1.45; word-break: break-word; }

.toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: color .2s;
  pointer-events: all;
}
.toast-close:hover { color: white; }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.5);
  animation: toastProgress linear forwards;
  border-radius: 0 0 0 .875rem;
}

@keyframes toastIn {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; max-height: 200px; margin-bottom: .75rem; }
  to   { transform: translateX(110%); opacity: 0; max-height: 0; margin-bottom: 0; padding: 0; }
}
@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ===== BLOCKED / REJECTED OVERLAYS ===== */
.blocked-overlay,
.rejected-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.97);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 2rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.blocked-overlay.active,
.rejected-overlay.active { display: flex; }

.blocked-content,
.rejected-content {
  text-align: center;
  max-width: 480px;
  animation: fadeInSlide .5s ease-out forwards;
}

.blocked-icon,
.rejected-icon { margin-bottom: 1.5rem; }
.blocked-icon i,
.rejected-icon i { color: #ef4444; }

.blocked-content h2,
.rejected-content h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: white;
  margin-bottom: 1rem;
}
.blocked-content p,
.rejected-content p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.blocked-contact-btn,
.rejected-register-btn {
  display: inline-block;
  padding: .75rem 2rem;
  background: #ef4444;
  color: white;
  border-radius: .75rem;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  transition: background .2s, transform .2s;
  letter-spacing: .02em;
}
.blocked-contact-btn:hover,
.rejected-register-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

/* ===== SPINNER ===== */
.spin-icon {
  display: inline-block;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary-hover); }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  #toast-container {
    bottom: 1rem;
    right: .75rem;
    left: .75rem;
    width: auto;
    max-width: 100%;
  }
  .trial-banner { top: 64px; font-size: .875rem; }
}