/*
 * PING4SMS mobile app experience
 * Load this file AFTER css/landing.css.
 * Desktop styles are intentionally untouched.
 */

@media (max-width: 640px) {
  :root {
    --m-app-bg: #f4f6fb;
    --m-app-card: #ffffff;
    --m-app-ink: #111827;
    --m-app-muted: #667085;
    --m-app-purple: #6d3bff;
    --m-app-pink: #e4247c;
    --m-app-line: #e7eaf1;
    --m-app-shadow: 0 14px 38px rgba(29, 22, 61, .10);
  }

  body.p4s-mobile-app {
    background: var(--m-app-bg);
    padding-top: 64px;
    padding-bottom: 92px;
  }

  .p4s-mobile-app .container {
    width: 100%;
    padding-left: 14px;
    padding-right: 14px;
  }

  /* Native-app style top bar */
  .p4s-mobile-app .nav {
    height: 64px;
    background: rgba(255, 255, 255, .96) !important;
    border-bottom: 1px solid var(--m-app-line);
    box-shadow: 0 5px 20px rgba(17, 24, 39, .06);
  }

  .p4s-mobile-app .navin {
    height: 64px;
  }

  .p4s-mobile-app .logo img {
    height: 30px !important;
    max-width: 170px;
  }

  .p4s-mobile-app .menu-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 14px;
    background: #f5f3ff;
    border-color: #e5e0ff;
    color: #392f51;
  }

  .p4s-mobile-app .navlinks {
    top: 70px !important;
    left: 14px !important;
    right: 14px !important;
    border-radius: 22px;
  }

  /* Compact app home screen */
  .p4s-mobile-app .hero {
    padding: 16px 0 22px;
    background:
      radial-gradient(circle at 12% 0, rgba(228, 36, 124, .12), transparent 34%),
      radial-gradient(circle at 96% 4%, rgba(109, 59, 255, .16), transparent 38%),
      var(--m-app-bg);
  }

  .p4s-mobile-app .hero::before {
    display: none;
  }

  .p4s-mobile-app .hero-grid {
    display: flex !important;
    flex-direction: column;
    gap: 14px;
  }

  .p4s-mobile-app .hero-grid > div:first-child {
    width: 100%;
    background: linear-gradient(145deg, #1a1430, #392f51 55%, #6d3bff);
    border-radius: 26px;
    padding: 20px;
    color: #fff;
    box-shadow: 0 18px 44px rgba(57, 47, 81, .24);
    overflow: hidden;
    position: relative;
  }

  .p4s-mobile-app .hero-grid > div:first-child::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    right: -72px;
    top: -68px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .10);
  }

  .p4s-mobile-app .hero .eyebrow {
    padding: 7px 10px;
    background: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 10px;
    position: relative;
    z-index: 1;
  }

  .p4s-mobile-app .hero h1 {
    color: #fff;
    font-size: 29px;
    line-height: 1.08;
    letter-spacing: -.9px;
    margin: 13px 0 10px;
    position: relative;
    z-index: 1;
  }

  .p4s-mobile-app .hero h1 span {
    background: linear-gradient(90deg, #ffd7e9, #fff);
    -webkit-background-clip: text;
    color: transparent;
  }

  .p4s-mobile-app .hero-grid > div:first-child > p {
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    position: relative;
    z-index: 1;
  }

  .p4s-mobile-app .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin: 15px 0 0;
    position: relative;
    z-index: 1;
  }

  .p4s-mobile-app .hero-actions .btn {
    width: 100%;
    min-height: 46px;
    padding: 10px 8px;
    border-radius: 14px;
    font-size: 12px;
  }

  .p4s-mobile-app .hero-actions .btn:nth-child(3) {
    display: none;
  }

  .p4s-mobile-app .hero-proof {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin-top: 12px;
    position: relative;
    z-index: 1;
  }

  .p4s-mobile-app .proof-mini {
    padding: 9px 5px;
    text-align: center;
    background: rgba(255, 255, 255, .09);
    border-color: rgba(255, 255, 255, .12);
    border-radius: 13px;
    box-shadow: none;
  }

  .p4s-mobile-app .proof-mini strong {
    color: #fff;
    font-size: 16px;
  }

  .p4s-mobile-app .proof-mini small {
    display: block;
    color: rgba(255, 255, 255, .65);
    font-size: 8px;
    line-height: 1.2;
  }

  /* Conversion form stays visible and keeps the original backend */
  .p4s-mobile-app .form-card {
    width: 100%;
    margin-top: 0;
    padding: 18px;
    border: 1px solid var(--m-app-line);
    border-radius: 26px;
    background: var(--m-app-card);
    box-shadow: var(--m-app-shadow);
  }

  .p4s-mobile-app .form-card h3 {
    font-size: 21px;
    color: var(--m-app-ink);
  }

  .p4s-mobile-app .form-card > p {
    font-size: 12px;
    line-height: 1.45;
    margin-bottom: 13px;
  }

  .p4s-mobile-app .mobile-form-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0 16px;
  }

  .p4s-mobile-app .mobile-form-progress span {
    height: 5px;
    flex: 1;
    border-radius: 99px;
    background: #eceef4;
    transition: .25s ease;
  }

  .p4s-mobile-app .mobile-form-progress span.active {
    background: linear-gradient(90deg, var(--m-app-purple), var(--m-app-pink));
  }

  .p4s-mobile-app .mobile-form-progress b {
    min-width: 54px;
    color: var(--m-app-muted);
    font-size: 11px;
    text-align: right;
  }

  .p4s-mobile-app .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .p4s-mobile-app .field {
    min-width: 0;
  }

  .p4s-mobile-app .field label {
    font-size: 11px;
  }

  .p4s-mobile-app .field input,
  .p4s-mobile-app .field select {
    height: 48px !important;
    border-radius: 13px !important;
    padding: 0 11px !important;
    font-size: 13px;
  }

  .p4s-mobile-app .mobile-step-hidden {
    display: none !important;
  }

  .p4s-mobile-app .mobile-form-controls {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 9px;
    margin-top: 2px;
  }

  .p4s-mobile-app .mobile-form-controls.single {
    grid-template-columns: 1fr;
  }

  .p4s-mobile-app .mobile-form-controls .btn {
    width: 100%;
    min-height: 49px;
    border-radius: 14px;
  }

  .p4s-mobile-app .recaptcha-box {
    width: 304px;
    max-width: 100%;
    transform: scale(.86);
    transform-origin: left top;
    min-height: 67px;
  }

  .p4s-mobile-app .form-note {
    font-size: 10px;
  }

  /* Sections feel like app modules rather than a squeezed desktop page */
  .p4s-mobile-app .section {
    padding: 28px 0;
  }

  .p4s-mobile-app .section-head {
    text-align: left;
    margin-bottom: 17px;
  }

  .p4s-mobile-app .section-head h2 {
    font-size: 23px;
    line-height: 1.15;
    letter-spacing: -.5px;
  }

  .p4s-mobile-app .section-head p {
    font-size: 13px;
  }

  .p4s-mobile-app .trust-row {
    padding: 16px 0;
  }

  .p4s-mobile-app .trust-grid {
    display: flex;
    overflow-x: auto;
    gap: 9px;
    scrollbar-width: none;
  }

  .p4s-mobile-app .trust-grid::-webkit-scrollbar,
  .p4s-mobile-app .usecase-grid::-webkit-scrollbar,
  .p4s-mobile-app .pricing-grid::-webkit-scrollbar,
  .p4s-mobile-app .google-review-grid::-webkit-scrollbar {
    display: none;
  }

  .p4s-mobile-app .trust-grid strong,
  .p4s-mobile-app .trust-pill {
    flex: 0 0 auto;
  }

  .p4s-mobile-app .trust-grid strong {
    width: 225px;
    font-size: 14px;
  }

  .p4s-mobile-app .trust-pill {
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 11px;
  }

  .p4s-mobile-app .usecase-grid,
  .p4s-mobile-app .price-set.pricing-grid,
  .p4s-mobile-app .google-review-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 4px 2px 18px;
    scrollbar-width: none;
  }

  /* `.hide` must win over the horizontal price-card layout. */
  .p4s-mobile-app .price-set.hide {
    display: none !important;
  }

  .p4s-mobile-app .price-set:not(.hide) {
    display: flex !important;
    animation: mobilePriceIn .28s ease both;
  }

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

  .p4s-mobile-app .usecase,
  .p4s-mobile-app .premium-price-card,
  .p4s-mobile-app .google-review-card {
    flex: 0 0 86%;
    scroll-snap-align: center;
    border-radius: 22px;
  }

  /* SaaS-style pricing selector */
  .p4s-mobile-app .pricing-section {
    background:
      radial-gradient(circle at 100% 0, rgba(109, 59, 255, .12), transparent 30%),
      linear-gradient(180deg, #f8f7ff, #f4f6fb);
  }

  .p4s-mobile-app .pricing-section .section-head {
    margin-bottom: 16px;
  }

  .p4s-mobile-app .pricing-trust {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
  }

  .p4s-mobile-app .pricing-trust div {
    min-height: 48px;
    padding: 10px;
    border-radius: 14px;
    font-size: 10px;
    text-align: left;
    display: flex;
    align-items: center;
    box-shadow: 0 7px 20px rgba(16, 24, 40, .05);
  }

  .p4s-mobile-app .pricing-trust i {
    width: 28px;
    height: 28px;
    margin-right: 7px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--m-app-purple), var(--m-app-pink));
  }

  .p4s-mobile-app .pricing-tabs.premium-tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 7px;
    margin: 0 0 10px;
    padding: 8px;
    overflow: visible;
    border: 1px solid #e4e0f5;
    border-radius: 21px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 14px 36px rgba(57, 47, 81, .10);
  }

  .p4s-mobile-app .premium-tabs .tab-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 48px;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: #f5f6fa;
    color: #596579;
    font-size: 11px;
    font-weight: 850;
    white-space: normal;
    line-height: 1.18;
    text-align: left;
    box-shadow: none;
  }

  .p4s-mobile-app .premium-tabs .tab-btn i {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #fff;
    color: var(--m-app-purple);
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(16, 24, 40, .07);
  }

  .p4s-mobile-app .premium-tabs .tab-btn.active {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #392f51, var(--m-app-purple));
    box-shadow: 0 9px 20px rgba(109, 59, 255, .22);
  }

  .p4s-mobile-app .premium-tabs .tab-btn.active i {
    background: rgba(255, 255, 255, .16);
    color: #fff;
    box-shadow: none;
  }

  .p4s-mobile-app .pricing-swipe-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 2px 4px;
    color: #667085;
    font-size: 11px;
    font-weight: 750;
  }

  .p4s-mobile-app .pricing-swipe-hint strong {
    color: #392f51;
    font-size: 12px;
  }

  .p4s-mobile-app .price-set.pricing-grid {
    margin: 0 -14px;
    padding: 14px 14px 24px;
    scroll-padding-inline: 14px;
  }

  .p4s-mobile-app .price-set .premium-price-card {
    flex-basis: 88%;
    padding: 22px;
    border-radius: 24px;
    box-shadow: 0 17px 42px rgba(29, 22, 61, .10);
  }

  .p4s-mobile-app .price-set .premium-price-card.featured {
    border: 2px solid var(--m-app-purple);
    background: linear-gradient(180deg, #fff, #faf8ff);
    transform: none !important;
  }

  .p4s-mobile-app .price-set .plan-icon {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: linear-gradient(135deg, #eee9ff, #ffe8f3);
  }

  .p4s-mobile-app .price-set .plan-name h3 {
    font-size: 21px;
  }

  .p4s-mobile-app .price-set .sms-count {
    margin-top: 4px;
    color: #5b35d5;
    font-size: 14px;
  }

  .p4s-mobile-app .price-set .premium-price {
    margin: 10px 0;
    font-size: 34px;
  }

  .p4s-mobile-app .price-set .per-sms {
    font-size: 11px;
  }

  .p4s-mobile-app .price-set .premium-price-card ul {
    gap: 8px;
    margin: 17px 0;
  }

  .p4s-mobile-app .price-set .premium-price-card li {
    font-size: 12px;
  }

  .p4s-mobile-app .why-grid,
  .p4s-mobile-app .includes-grid,
  .p4s-mobile-app .faq-grid {
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .p4s-mobile-app .dlt,
  .p4s-mobile-app .next-steps {
    padding: 22px;
    border-radius: 25px;
  }

  .p4s-mobile-app .dashboard-shot img {
    height: auto;
  }

  .p4s-mobile-app .code-card {
    border-radius: 20px;
  }

  .p4s-mobile-app .code {
    font-size: 11px;
  }

  .p4s-mobile-app .mega {
    padding-bottom: 100px;
  }

  /* Replace the old 3-button strip with an app bottom navigation */
  .p4s-mobile-app .mobile-sticky {
    display: none !important;
  }

  .p4s-bottom-nav {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 99992;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: 68px;
    padding: 7px 5px;
    background: rgba(255, 255, 255, .97);
    border: 1px solid var(--m-app-line);
    border-radius: 22px;
    box-shadow: 0 16px 45px rgba(17, 24, 39, .20);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .p4s-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #667085;
    font-size: 9px;
    font-weight: 800;
    border-radius: 14px;
  }

  .p4s-bottom-nav a i {
    font-size: 18px;
  }

  .p4s-bottom-nav a.demo-action {
    color: #fff;
    background: linear-gradient(135deg, var(--m-app-purple), var(--m-app-pink));
    transform: translateY(-12px);
    min-height: 58px;
    border: 4px solid var(--m-app-bg);
    border-radius: 18px;
    box-shadow: 0 10px 26px rgba(109, 59, 255, .28);
  }

  .p4s-mobile-app .ai-chat-btn-wrap {
    bottom: 88px !important;
  }

  .p4s-mobile-app .otp-popup {
    width: calc(100% - 28px);
    max-width: 380px;
    border-radius: 25px;
  }
}

@media (max-width: 370px) {
  .p4s-mobile-app .form-grid {
    grid-template-columns: 1fr;
  }

  .p4s-mobile-app .field,
  .p4s-mobile-app .mobile-form-controls {
    grid-column: 1 / -1;
  }
}
