/* iOSstudy - Custom Styles */

:root {
  --ios-white: #FFFFFF;
  --ios-soft-bg: #F6F8FB;
  --ios-primary: #111318;
  --ios-secondary: #4B5563;
  --ios-accent: #2563EB;
  --ios-accent-hover: #1D4ED8;
  --ios-accent-light: #DBEAFE;
  --ios-graphite: #1F2937;
  --ios-border: #E5E7EB;
  --ios-success: #10B981;
  --ios-warning: #F59E0B;
}

/* Typography */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: var(--ios-primary);
  background: var(--ios-white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ios-primary);
}

.display-4 {
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* Navigation */
.navbar {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.85) !important;
  border-bottom: 1px solid var(--ios-border);
}

.navbar-brand {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ios-primary) !important;
}

.navbar-brand img {
  height: 52px;
  width: 52px;
  object-fit: contain;
}

.navbar-brand span {
  font-size: 1.35rem;
}

.nav-link {
  font-weight: 500;
  color: var(--ios-secondary) !important;
  padding: 0.5rem 1rem !important;
  position: relative;
}

.nav-link:hover {
  color: var(--ios-primary) !important;
}

.nav-link.active {
  color: var(--ios-accent) !important;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--ios-accent);
  border-radius: 2px;
}

/* Пилюли (переключатель на логине): у активной — синяя заливка Bootstrap,
   поэтому текст белый, а подчёркивание от навбара здесь не нужно */
.nav-pills .nav-link.active {
  color: #fff !important;
  background: var(--ios-accent);
}
.nav-pills .nav-link.active::after {
  display: none;
}

/* Якоря: прыжок к секции не должен прятать её заголовок под фикс-шапкой */
section[id], [id].plan-card {
  scroll-margin-top: 84px;
}

/* Buttons */
.btn-primary {
  background: var(--ios-accent);
  border: none;
  border-radius: 10px;
  padding: 0.875rem 2rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: var(--ios-accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-outline-secondary {
  border: 1px solid var(--ios-border);
  border-radius: 10px;
  padding: 0.875rem 2rem;
  font-weight: 600;
  color: var(--ios-primary);
  transition: all 0.2s ease;
}

.btn-outline-secondary:hover {
  background: var(--ios-soft-bg);
  border-color: #D1D5DB;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.625rem 1.25rem;
}

.btn-lg {
  padding: 1rem 2.5rem;
}

/* Cards */
.card {
  border: 1px solid var(--ios-border);
  border-radius: 16px;
  transition: all 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
}

.card-featured {
  position: relative;
  overflow: hidden;
}

.card-featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ios-accent), #3B82F6);
}

/* Badges */
.badge-ios {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  display: inline-block;
  margin-bottom: 0.75rem;
}

.badge-foundation {
  background: #F3F4F6;
  color: #374151;
}

.badge-flagship {
  background: #1D4ED8;
  color: white;
}

.badge-ai {
  background: #7C3AED;
  color: white;
}

.badge-unity {
  background: #059669;
  color: white;
}

.badge-coming-soon {
  background: #FEF3C7;
  color: #B45309;
}

/* Sections */
.section {
  padding: 5rem 0;
}

.section-sm {
  padding: 3rem 0;
}

.section-lg {
  padding: 7rem 0;
}

.bg-soft {
  background: var(--ios-soft-bg);
}

.bg-dark-section {
  background: var(--ios-graphite);
}

/* Headings inside dark / white-text contexts must not fall back to dark ink */
.bg-dark-section h1, .bg-dark-section h2, .bg-dark-section h3,
.bg-dark-section h4, .bg-dark-section h5, .bg-dark-section h6 {
  color: #fff;
}

.text-white h1, .text-white h2, .text-white h3,
.text-white h4, .text-white h5, .text-white h6 {
  color: inherit;
}

/* Trust Strip */
.trust-strip {
  background: var(--ios-soft-bg);
  border-top: 1px solid var(--ios-border);
  border-bottom: 1px solid var(--ios-border);
  padding: 1.25rem 0;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.trust-item svg {
  color: var(--ios-accent);
}

/* Feature Cards */
.feature-card {
  background: white;
  border: 1px solid var(--ios-border);
  border-radius: 16px;
  padding: 1.5rem;
  height: 100%;
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--ios-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.feature-icon svg {
  color: var(--ios-accent);
}

/* Course Cards */
.course-card {
  background: white;
  border: 1px solid var(--ios-border);
  border-radius: 16px;
  padding: 1.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.course-card .card-body {
  flex: 1;
}

/* Stats Cards */
.stat-card {
  background: var(--ios-soft-bg);
  border: 1px solid var(--ios-border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--ios-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  color: var(--ios-accent);
}

/* Forms */
.form-control, .form-select {
  border: 1px solid var(--ios-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--ios-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
  font-weight: 500;
  color: var(--ios-primary);
  margin-bottom: 0.5rem;
}

/* Auth Pages */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ios-soft-bg);
}

.auth-card {
  background: white;
  border: 1px solid var(--ios-border);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ios-border);
}

.auth-divider span {
  padding: 0 1rem;
  color: var(--ios-secondary);
  font-size: 0.875rem;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem;
  border: 1px solid var(--ios-border);
  border-radius: 10px;
  background: white;
  color: var(--ios-primary);
  font-weight: 500;
  transition: all 0.2s ease;
}

.social-btn:hover {
  background: var(--ios-soft-bg);
  border-color: #D1D5DB;
}

/* Calendar */
.calendar-container {
  background: white;
  border: 1px solid var(--ios-border);
  border-radius: 16px;
  overflow: hidden;
}

.calendar-header {
  background: var(--ios-soft-bg);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--ios-border);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 1rem;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.calendar-day:hover {
  background: var(--ios-accent-light);
}

.calendar-day.selected {
  background: var(--ios-accent);
  color: white;
}

.calendar-day.disabled {
  color: #D1D5DB;
  cursor: not-allowed;
}

.calendar-day.available {
  background: #D1FAE5;
  color: #065F46;
}

.calendar-day-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0;
  font-size: 0.75rem;
}

/* Time Slots */
.time-slot {
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--ios-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-weight: 500;
}

.time-slot:hover {
  border-color: var(--ios-accent);
  background: var(--ios-accent-light);
}

.time-slot.selected {
  background: var(--ios-accent);
  color: white;
  border-color: var(--ios-accent);
}

/* Footer */
.footer {
  background: var(--ios-graphite);
  color: white;
  padding: 4rem 0 2rem;
}

.footer a {
  color: #9CA3AF;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: white;
}

.footer-brand {
  font-weight: 600;
  color: white;
  font-size: 1.25rem;
}

/* Affirm Badge */
.affirm-badge {
  background: linear-gradient(135deg, #0FA0EA 0%, #0070BA 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Affirm Real Logo Block */
.affirm-block {
  background: #F7F8FA;
  border: 1px solid var(--ios-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.affirm-logo-text {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: #4A4AF4;
  font-style: italic;
}

/* Course Hero Image */
.course-hero-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Hero */
.hero {
  padding: 6rem 0;
}

.hero-illustration {
  max-width: 100%;
  height: auto;
}

/* Responsive */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    margin-top: 1rem;
    border: 1px solid var(--ios-border);
  }
  
  .nav-link.active::after {
    display: none;
  }
  
  .hero {
    padding: 4rem 0;
  }
  
  .section {
    padding: 3rem 0;
  }
}

/* Course Detail Page */
.course-hero {
  background: linear-gradient(180deg, var(--ios-soft-bg) 0%, white 100%);
  padding: 4rem 0;
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.course-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ios-secondary);
}

.course-sidebar {
  position: sticky;
  top: 100px;
}

.price-card {
  background: white;
  border: 1px solid var(--ios-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.price-tag {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--ios-primary);
}

.curriculum-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--ios-border);
}

.curriculum-item:last-child {
  border-bottom: none;
}

/* Instructor */
.instructor-card {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--ios-soft-bg);
  border-radius: 12px;
}

.instructor-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ios-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ios-accent);
}

/* Testimonials */
.testimonial-card {
  background: white;
  border: 1px solid var(--ios-border);
  border-radius: 16px;
  padding: 1.5rem;
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ios-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Success State */
.success-state {
  text-align: center;
  padding: 3rem;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #D1FAE5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}

.success-icon svg {
  color: #059669;
  width: 32px;
  height: 32px;
}

/* ============================================================
   Rebuild: "Build your own app business" model components
   (built on the existing --ios-* tokens above)
   ============================================================ */

/* Free badge variant (pairs with .badge-ios) */
.badge-free {
  background: var(--ios-success);
  color: white;
}

/* Version / edition badges — freshness + frozen states */
.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.version-badge.frozen {
  background: #F3F4F6;
  color: #6B7280;
  border-color: var(--ios-border);
}

.version-badge i { font-size: 0.85rem; }

/* Freshness strip — "content that never goes stale" */
.freshness-strip {
  background: linear-gradient(180deg, #F0FDF4 0%, var(--ios-soft-bg) 100%);
  border-top: 1px solid #D1FAE5;
  border-bottom: 1px solid var(--ios-border);
  padding: 1.25rem 0;
}

/* Pricing plan cards — the two-choice storefront */
.plan-card {
  background: white;
  border: 1px solid var(--ios-border);
  border-radius: 20px;
  padding: 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.07);
}

.plan-card.featured {
  border-color: var(--ios-accent);
  box-shadow: 0 0 0 2px var(--ios-accent), 0 12px 28px rgba(37, 99, 235, 0.12);
}

.plan-badge {
  position: absolute;
  top: -0.9rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ios-accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: 100px;
}

.plan-price {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.plan-price small {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ios-secondary);
}

.plan-feature {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

.plan-feature i {
  color: var(--ios-accent);
  margin-top: 0.15rem;
  flex-shrink: 0;
}

/* Account state cards — represent the subscription state machine */
.state-card {
  background: white;
  border: 1px solid var(--ios-border);
  border-left-width: 4px;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  height: 100%;
}

.state-active { border-left-color: var(--ios-success); }
.state-limited { border-left-color: var(--ios-warning); }
.state-frozen { border-left-color: #9CA3AF; }
.state-none { border-left-color: #EF4444; }

.owned-pill {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 100px;
  background: var(--ios-accent-light);
  color: var(--ios-accent-hover);
  display: inline-block;
}

/* Ship Your App — premium tier cards */
.tier-card {
  background: white;
  border: 1px solid var(--ios-border);
  border-radius: 16px;
  padding: 1.75rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.tier-card.featured {
  border-color: var(--ios-accent);
  box-shadow: 0 0 0 2px var(--ios-accent);
}

.tier-price {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ============================================================
   AI-tutor repack: 0 / 99 / 199 model components
   ============================================================ */

/* Video placeholder frame (process demo slot) */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #1F2937 0%, #111318 100%);
  border-radius: 20px;
  border: 1px solid var(--ios-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-play {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ios-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.video-play:hover { transform: scale(1.06); }

.video-caption {
  position: absolute;
  bottom: 1rem;
  left: 1.25rem;
  right: 1.25rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  font-weight: 500;
}

.video-tag {
  position: absolute;
  top: 1rem;
  left: 1.25rem;
}

/* AI tutor chat mock */
.chat-card {
  background: white;
  border: 1px solid var(--ios-border);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-bubble {
  border-radius: 14px;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  max-width: 92%;
}

.chat-user {
  background: var(--ios-accent);
  color: white;
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.chat-ai {
  background: var(--ios-soft-bg);
  border: 1px solid var(--ios-border);
  color: var(--ios-primary);
  border-bottom-left-radius: 4px;
}

.chat-meta {
  font-size: 0.72rem;
  color: var(--ios-secondary);
}

/* Usage / progress meter */
.usage-meter {
  height: 8px;
  border-radius: 100px;
  background: var(--ios-border);
  overflow: hidden;
}

.usage-meter > span {
  display: block;
  height: 100%;
  border-radius: 100px;
  background: var(--ios-accent);
}

/* Roadmap to release */
.roadmap-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--ios-border);
}

.roadmap-step:last-child { border-bottom: none; }

.roadmap-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.roadmap-done .roadmap-dot { background: #D1FAE5; color: #047857; }
.roadmap-current .roadmap-dot { background: var(--ios-accent); color: white; }
.roadmap-next .roadmap-dot { background: #F3F4F6; color: #6B7280; }
.roadmap-next { opacity: 0.75; }

/* Student app tiles (social proof) */
.app-tile {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: white;
  border: 1px solid var(--ios-border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  height: 100%;
}

.app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  background: var(--ios-accent-light);
}

/* Locked library item (All-Access library visual) */
.lib-item {
  position: relative;
  border: 1px solid var(--ios-border);
  border-radius: 14px;
  overflow: hidden;
  background: white;
  height: 100%;
}

.lib-item.locked .lib-body { opacity: 0.5; }

.locked-overlay {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(17, 19, 24, 0.75);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  z-index: 2;
}

/* Hero-бейдж: фирменный, с градиентной рамкой и медленным мерцанием.
   Текст стандартного позиционирования — вид, который не спутаешь с чужим. */
.badge-hero {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--ios-soft-bg, #F6F8FB), var(--ios-soft-bg, #F6F8FB)) padding-box,
    linear-gradient(110deg, #2563EB, #7C3AED, #06B6D4, #2563EB) border-box;
  background-size: 100% 100%, 300% 100%;
  animation: badge-hero-shimmer 7s linear infinite;
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .02em;
  color: var(--ios-primary, #111318);
}
.badge-hero i { color: var(--ios-accent, #2563EB); }
@keyframes badge-hero-shimmer {
  to { background-position: 0 0, 300% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .badge-hero { animation: none; }
}
