/* =================================================================
   MOTO TUNE LAB — custom styles
   Only what Tailwind utilities can't express cleanly:
   reveal animations, component classes, subtle decorative grid.
   ================================================================= */

/* ---------- Reusable component classes (via @apply-like manual CSS) ---------- */

/* ---------- PROLOGIC logo (navbar) ---------- */
.prologic-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-weight: 700;
    user-select: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.25s ease;
}

.prologic-logo:hover {
    opacity: 0.92;
}

.logo-mark-wrap {
    display: block;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 12px;
    filter: drop-shadow(0 0 7px rgba(255, 85, 0, 0.35));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo-mark-wrap img {
    display: block;
    width: 100%;
    height: 100%;
}

.prologic-logo:hover .logo-mark-wrap {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px rgba(255, 85, 0, 0.5));
}

.logo-text {
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.orange-text {
    color: #ff5500;
    text-shadow: 0 0 10px rgba(255, 85, 0, 0.4);
}

/* Navigation links */
.nav-link {
    position: relative;
    font-size: 0.875rem;
    font-weight: 500;
    color: #9ca3af;
    transition: color 0.25s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 0;
    height: 2px;
    background: #ff6b00;
    transition: width 0.25s ease;
}

.nav-link:hover {
    color: #fff;
}

.nav-link:hover::after {
    width: 100%;
}

.mobile-link {
    padding: 0.75rem 0.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    color: #d1d5db;
    transition: background 0.2s ease, color 0.2s ease;
}

.mobile-link:hover {
    background: #212737;
    color: #fff;
}

/* Divider separating the main nav from the B2B "Файловый сервис" link */
.nav-divider {
    width: 1px;
    height: 20px;
    background: #2c3346;
}

.nav-link--accent {
    color: #ff6b00;
}

.nav-link--accent:hover {
    color: #ff8124;
}

/* Persistent underline for the link matching the page currently open */
.nav-link.is-current::after {
    width: 100%;
}

.mobile-divider {
    height: 1px;
    margin: 0.5rem 0.5rem;
    background: #2c3346;
}

.mobile-link--accent {
    color: #ff6b00;
}

.mobile-link--accent:hover {
    color: #fff;
}

.mobile-link--current {
    background: rgba(255, 107, 0, 0.08);
    color: #fff;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.6rem;
    border-radius: 0.75rem;
    background: #ff6b00;
    color: #1a1f2c;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.3s ease, background 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: #ff8124;
    box-shadow: 0 0 0 1px rgba(255, 107, 0, 0.4), 0 12px 30px -10px rgba(255, 107, 0, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.6rem;
    border-radius: 0.75rem;
    color: #d1d5db;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid #2c3346;
    transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.btn-ghost:hover {
    color: #fff;
    border-color: #ff6b00;
    background: rgba(255, 107, 0, 0.06);
}

/* Hero CTA gentle pulse to draw the eye (respects reduced motion below) */
.btn-primary {
    animation: cta-pulse 2.6s ease-in-out infinite;
}

@keyframes cta-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 107, 0, 0.35);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 107, 0, 0);
    }
}

/* The pulse is distracting on form submit / ghost contexts; keep only hero & form fine */

/* Hero technique switcher */
.tech-switch {
    color: #9ca3af;
}

.tech-switch.is-active {
    background: #ff6b00;
    color: #1a1f2c;
}

/* Hero dynamic preview — bullet list (rendered via JS innerHTML) */
.preview-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.preview-list li {
    position: relative;
    padding-left: 1.25rem;
    color: #d1d5db;
    font-size: 0.95rem;
    line-height: 1.55;
}

.preview-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 999px;
    background: #ff6b00;
}

/* Service cards */
.service-card {
    position: relative;
    padding: 1.75rem;
    border-radius: 1rem;
    background: #212737;
    border: 1px solid #2c3346;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 107, 0, 0.5);
    box-shadow: 0 0 25px -8px rgba(255, 107, 0, 0.35);
}

.card-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: rgba(255, 107, 0, 0.1);
    border: 1px solid rgba(255, 107, 0, 0.3);
    color: #ff6b00;
    margin-bottom: 1.25rem;
    transition: transform 0.3s ease;
}

.service-card:hover .card-icon {
    transform: scale(1.08);
}

.card-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    margin-bottom: 0.75rem;
}

.card-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ff6b00;
    background: rgba(255, 107, 0, 0.08);
    border: 1px solid rgba(255, 107, 0, 0.25);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.9rem;
}

.card-text {
    color: #9ca3af;
    font-size: 0.92rem;
    line-height: 1.65;
}

/* Wrapper for a row of .card-tag pills (e.g. supported ECU models) */
.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-row .card-tag {
    margin-bottom: 0;
}

/* Contact rows */
.contact-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 0.85rem;
    background: #212737;
    border: 1px solid #2c3346;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

a.contact-row:hover {
    border-color: rgba(255, 107, 0, 0.5);
    transform: translateX(3px);
}

.contact-ic {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    background: rgba(255, 107, 0, 0.1);
    color: #ff6b00;
}

.contact-ic svg {
    width: 1.25rem;
    height: 1.25rem;
}

.contact-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.contact-value {
    display: block;
    font-weight: 600;
    color: #fff;
}

/* Messenger inline buttons */
.messenger-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 0.7rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #d1d5db;
    background: #212737;
    border: 1px solid #2c3346;
    transition: all 0.25s ease;
}

.messenger-btn:hover {
    color: #fff;
    border-color: #ff6b00;
    transform: translateY(-2px);
}

/* Floating dock buttons */
.float-btn {
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 999px;
    color: #1a1f2c;
    background: #ff6b00;
    box-shadow: 0 10px 25px -8px rgba(255, 107, 0, 0.7);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.float-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 14px 30px -8px rgba(255, 107, 0, 0.85);
}

/* Viber floating button — authentic brand purple */
.float-btn--viber {
    background: #7360f2;
    color: #fff;
    box-shadow: 0 10px 25px -8px rgba(115, 96, 242, 0.7);
}

.float-btn--viber:hover {
    box-shadow: 0 14px 30px -8px rgba(115, 96, 242, 0.85);
}

/* "Онлайн запись" floating button — outline style vs. the solid messenger colors */
.float-btn--order {
    background: #212737;
    color: #ff6b00;
    border: 1px solid rgba(255, 107, 0, 0.5);
    box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.55);
}

.float-btn--order:hover {
    background: #2c3346;
    box-shadow: 0 14px 30px -8px rgba(255, 107, 0, 0.4);
}

/* FAQ accordion — built on native <details>/<summary> (no JS, fully crawlable) */
.faq-item {
    border-radius: 1rem;
    border: 1px solid #2c3346;
    background: #212737;
    padding: 1.1rem 1.25rem;
}

.faq-item + .faq-item {
    margin-top: 0.75rem;
}

.faq-item summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-weight: 600;
    color: #fff;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-chevron {
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    color: #ff6b00;
    transition: transform 0.25s ease;
}

.faq-item[open] .faq-chevron {
    transform: rotate(180deg);
}

.faq-item .faq-answer {
    margin-top: 0.85rem;
    color: #9ca3af;
    font-size: 0.92rem;
    line-height: 1.65;
}


#map {
    width: 100%;
    height: 100%;
    background: #1a1f2c;
}

/* Custom marker for YMapMarker (anchored so the tip sits on the coordinate) */
.map-pin {
    /* shift element up & left so the pin's bottom tip points at the coordinate */
    transform: translate(-50%, -100%);
    color: #ff6b00;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
    animation: marker-bounce 2.2s ease-in-out infinite;
    will-change: transform;
}

.map-pin svg {
    display: block;
    width: 2.25rem;
    height: 2.25rem;
}

/* Centered overlay marker for the fallback (iframe) map */
.map-fallback-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 5;
    pointer-events: none;
    color: #ff6b00;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6));
    animation: marker-bounce 2.2s ease-in-out infinite;
}

.map-fallback-pin svg {
    display: block;
    width: 2.25rem;
    height: 2.25rem;
}

@keyframes marker-bounce {
    0%, 100% {
        transform: translate(-50%, -100%);
    }
    50% {
        transform: translate(-50%, -115%);
    }
}

/* Form */
.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 0.4rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.7rem;
    background: #1a1f2c;
    border: 1px solid #2c3346;
    color: #fff;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input::placeholder {
    color: #4b5563;
}

.form-input:focus {
    outline: none;
    border-color: #ff6b00;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15);
}

.form-input.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form-error {
    font-size: 0.75rem;
    color: #f87171;
    margin-top: 0.35rem;
    min-height: 0.9rem;
}

/* ---------- Decorative subtle grid (no heavy graphics) ---------- */
.bg-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
}

/* ---------- Scroll reveal (Intersection Observer) ---------- */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Accessibility: respect reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
    }
}
