/**
 * Try-On Page Styles — HairStyleMojo
 *
 * Extracted from WPCode snippet 27879 (Try-On v4.0).
 * Enqueued by functions.php on the /try-on/ page.
 *
 * @since Phase 6 migration
 */

/* =====================================================================
   HSM TRY-ON v4.0 — FULL PAGE / DESIGN SYSTEM ALIGNED
   Tokens match listicle v5.5 exactly
   ===================================================================== */

.hsm-to {
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    --blue: #4A8FE7;
    --blue-dark: #3A7BD5;
    --blue-pale: #F5F9FF;
    --blue-glow: rgba(74, 143, 231, 0.25);

    --charcoal: #2D3748;
    --charcoal-mid: #4A5568;
    --charcoal-light: #718096;
    --gray-100: #F7FAFC;
    --gray-200: #EDF2F7;
    --white: #FFFFFF;
    --border: #E2E8F0;

    --green: #38A169;
    --green-pale: #F0FFF4;
    --red: #E53E3E;
    --red-pale: #FFF5F5;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-hover: 0 12px 35px rgba(74,143,231,0.2);
    --ease: cubic-bezier(0.16, 1, 0.3, 1);

    font-family: var(--font-body);
    color: var(--charcoal);
    line-height: 1.6;
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.hsm-to *, .hsm-to *::before, .hsm-to *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hsm-to img { max-width: 100%; height: auto; display: block; }
.hsm-to a { text-decoration: none; color: inherit; }

/* ==========  SECTION 1 — HERO  ========== */

.hsm-to-hero {
    padding: 60px 0 0;
    background: var(--white);
    position: relative;
    overflow: hidden;
}
/* Soft blue blob behind hero for depth */
.hsm-to-hero::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(74,143,231,0.06), transparent 70%);
    top: -200px; right: -150px;
    border-radius: 50%;
    pointer-events: none;
}

.hsm-to-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* ---- Hero left: text + form ---- */
.hsm-to-hero-text {
    padding-bottom: 60px;
}

.hsm-to-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    background: var(--blue);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 50px;
    margin-bottom: 20px;
    animation: hsmFadeUp 0.5s var(--ease) both;
}
.hsm-to-badge svg { width: 14px; height: 14px; }

@keyframes hsmFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hsm-to-hero-text h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--charcoal);
    margin-bottom: 16px;
    animation: hsmFadeUp 0.5s var(--ease) 0.08s both;
}
.hsm-to-hero-text h1 em {
    font-style: italic;
    color: var(--blue);
}

.hsm-to-hero-desc {
    font-size: 17px;
    line-height: 1.7;
    color: var(--charcoal-mid);
    margin-bottom: 28px;
    max-width: 480px;
    animation: hsmFadeUp 0.5s var(--ease) 0.15s both;
}
.hsm-to-hero-desc strong { color: var(--charcoal); font-weight: 600; }

/* Progress bar */
.hsm-to-progress {
    margin-bottom: 28px;
    max-width: 400px;
    animation: hsmFadeUp 0.5s var(--ease) 0.2s both;
}
.hsm-to-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 500;
    color: var(--charcoal-light);
    margin-bottom: 8px;
}
.hsm-to-progress-label strong { color: var(--blue); font-weight: 700; }
.hsm-to-progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}
.hsm-to-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--blue), var(--blue-dark));
    border-radius: 3px;
    transition: width 1.8s var(--ease);
}
.hsm-to-progress-fill.go { width: 78%; }

/* Form */
.hsm-to-form-wrap {
    animation: hsmFadeUp 0.5s var(--ease) 0.25s both;
}
.hsm-to-msg {
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
    display: none;
}
.hsm-to-msg.error  { display: block; background: var(--red-pale); color: var(--red); border: 1px solid #FED7D7; }
.hsm-to-msg.success { display: block; background: var(--green-pale); color: #22543D; border: 1px solid #C6F6D5; }

.hsm-to-form {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.hsm-to-input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: 14px;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--charcoal);
    background: var(--white);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.hsm-to-input::placeholder { color: var(--charcoal-light); }
.hsm-to-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-glow);
}

.hsm-to-submit {
    padding: 16px 28px;
    background: var(--blue);
    border: none;
    border-radius: 14px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px var(--blue-glow);
}
.hsm-to-submit:hover {
    background: var(--blue-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}
.hsm-to-submit:active { transform: translateY(0); }
.hsm-to-submit:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.hsm-to-submit svg.hsm-arrow { width: 18px; height: 18px; }
.hsm-to-submit .hsm-spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: hsmSpin 0.6s linear infinite;
    display: none;
}
.hsm-to-submit.loading .hsm-spinner { display: block; }
.hsm-to-submit.loading .hsm-arrow  { display: none; }
@keyframes hsmSpin { to { transform: rotate(360deg); } }

/* Trust row */
.hsm-to-trust {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}
.hsm-to-trust-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--charcoal-light);
}
.hsm-to-trust-item svg { width: 14px; height: 14px; color: var(--green); flex-shrink: 0; }

/* ---- Hero right: visual ---- */
.hsm-to-hero-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 480px;
}

/* Style preview card (when ?style= present) */
.hsm-to-style-card {
    width: 320px;
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: hsmFadeUp 0.6s var(--ease) 0.3s both;
    position: relative;
    z-index: 2;
}
.hsm-to-style-img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    object-position: center 20%;
}
.hsm-to-style-info {
    padding: 18px 20px;
}
.hsm-to-style-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--blue);
    margin-bottom: 4px;
}
.hsm-to-style-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 500;
    color: var(--charcoal);
    line-height: 1.25;
}
.hsm-to-style-from {
    font-size: 13px;
    color: var(--charcoal-light);
    margin-top: 4px;
}

/* Decorative elements around the style card */
.hsm-to-deco {
    position: absolute;
    border-radius: 16px;
    background: var(--gray-100);
    border: 1px solid var(--border);
    z-index: 1;
}
.hsm-to-deco-1 {
    width: 180px; height: 220px;
    top: 20px; left: 0;
    transform: rotate(-6deg);
    animation: hsmFadeUp 0.6s var(--ease) 0.1s both;
}
.hsm-to-deco-2 {
    width: 160px; height: 200px;
    bottom: 10px; right: 0;
    transform: rotate(4deg);
    animation: hsmFadeUp 0.6s var(--ease) 0.18s both;
}

/* Generic visual (no style param) — phone mock */
.hsm-to-phone {
    width: 280px;
    height: 480px;
    background: var(--charcoal);
    border-radius: 40px;
    padding: 12px;
    box-shadow: var(--shadow-lg), inset 0 0 0 2px rgba(255,255,255,0.1);
    animation: hsmFadeUp 0.6s var(--ease) 0.3s both;
    position: relative;
    z-index: 2;
}
.hsm-to-phone-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(160deg, var(--blue-pale) 0%, var(--gray-100) 40%, var(--white) 100%);
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    text-align: center;
    overflow: hidden;
    position: relative;
}
.hsm-to-phone-icon {
    width: 56px; height: 56px;
    background: var(--blue);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    color: var(--white);
}
.hsm-to-phone-icon svg { width: 28px; height: 28px; }
.hsm-to-phone-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    color: var(--charcoal);
}
.hsm-to-phone-title em { color: var(--blue); font-style: italic; }
.hsm-to-phone-text {
    font-size: 12px;
    color: var(--charcoal-light);
    line-height: 1.5;
}
/* Scan line animation on phone */
.hsm-to-phone-screen::after {
    content: '';
    position: absolute;
    left: 20%; right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--blue), transparent);
    border-radius: 1px;
    animation: hsmScanLine 3s ease-in-out infinite;
    opacity: 0.6;
}
@keyframes hsmScanLine {
    0%   { top: 20%; opacity: 0; }
    10%  { opacity: 0.6; }
    50%  { top: 70%; opacity: 0.6; }
    60%  { opacity: 0; }
    100% { top: 20%; opacity: 0; }
}

/* ---- Hero responsive ---- */
@media (max-width: 960px) {
    .hsm-to-hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    .hsm-to-hero-desc { max-width: 100%; margin-left: auto; margin-right: auto; }
    .hsm-to-progress { max-width: 100%; margin-left: auto; margin-right: auto; }
    .hsm-to-trust { justify-content: center; }
    .hsm-to-hero-visual { min-height: auto; }
    .hsm-to-style-card { margin: 0 auto; }
    .hsm-to-phone { margin: 0 auto; }
    .hsm-to-deco { display: none; }
    .hsm-to-hero-text { padding-bottom: 0; }
}
@media (max-width: 600px) {
    .hsm-to-hero { padding: 40px 0 0; }
    .hsm-to-hero-inner { padding: 0 20px; gap: 32px; }
    .hsm-to-form { flex-direction: column; }
    .hsm-to-submit { justify-content: center; }
    .hsm-to-style-card { width: 100%; max-width: 300px; }
    .hsm-to-style-img { height: 300px; }
    .hsm-to-phone { width: 240px; height: 400px; }
}


/* ==========  SECTION 2 — HOW IT WORKS  ========== */

.hsm-to-how {
    padding: 70px 40px;
    background: var(--gray-100);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.hsm-to-how-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.hsm-to-section-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--blue);
    margin-bottom: 10px;
}
.hsm-to-section-label::before,
.hsm-to-section-label::after {
    content: '';
    width: 24px;
    height: 2px;
    background: var(--blue);
}

.hsm-to-how h2 {
    font-family: var(--font-display);
    font-size: clamp(26px, 3vw, 34px);
    font-weight: 500;
    color: var(--charcoal);
    margin-bottom: 10px;
}
.hsm-to-how h2 em { font-style: italic; color: var(--blue); }
.hsm-to-how > .hsm-to-how-inner > p {
    font-size: 16px;
    color: var(--charcoal-mid);
    margin-bottom: 48px;
}

.hsm-to-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}
.hsm-to-step {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 24px 28px;
    text-align: center;
    transition: all 0.35s ease;
    position: relative;
}
.hsm-to-step:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--blue);
}

.hsm-to-step-icon {
    width: 64px; height: 64px;
    background: var(--blue-pale);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: var(--blue);
    transition: all 0.35s ease;
}
.hsm-to-step:hover .hsm-to-step-icon {
    background: var(--blue);
    color: var(--white);
    transform: scale(1.08);
}
.hsm-to-step-icon svg { width: 28px; height: 28px; }

.hsm-to-step-num {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px; height: 28px;
    background: var(--blue);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 2px 8px var(--blue-glow);
}

.hsm-to-step h3 {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: 500;
    color: var(--charcoal);
    margin-bottom: 6px;
}
.hsm-to-step p {
    font-size: 14px;
    color: var(--charcoal-light);
    line-height: 1.6;
}

/* Connector line between steps */
.hsm-to-steps-connector {
    display: none; /* Only visible desktop */
}

@media (min-width: 769px) {
    .hsm-to-steps { position: relative; }
    .hsm-to-steps::before,
    .hsm-to-steps::after {
        content: '';
        position: absolute;
        top: 52px;
        height: 2px;
        background: var(--border);
        z-index: 0;
    }
    .hsm-to-steps::before {
        left: calc(33.33% - 14px);
        width: calc(33.33% + 28px - 56px);
        /* simplified: connector from step1 center to step2 center */
        left: 16.66%;
        width: 28%;
    }
    .hsm-to-steps::after {
        left: 55%;
        width: 28%;
    }
}

@media (max-width: 768px) {
    .hsm-to-how { padding: 50px 20px; }
    .hsm-to-steps { grid-template-columns: 1fr; max-width: 360px; margin: 0 auto; gap: 24px; }
}


/* ==========  SECTION 3 — SOCIAL PROOF + CTA REPEAT  ========== */

.hsm-to-proof {
    padding: 70px 40px;
    background: var(--white);
    text-align: center;
}
.hsm-to-proof-inner {
    max-width: 600px;
    margin: 0 auto;
}

.hsm-to-proof h2 {
    font-family: var(--font-display);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 500;
    color: var(--charcoal);
    margin-bottom: 24px;
}
.hsm-to-proof h2 em { font-style: italic; color: var(--blue); }

/* Avatars row */
.hsm-to-avatars-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 8px;
}
.hsm-to-avatars { display: flex; }
.hsm-to-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 3px solid var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    margin-left: -10px;
    box-shadow: var(--shadow-sm);
}
.hsm-to-avatar:first-child { margin-left: 0; }
.hsm-to-avatar:nth-child(1) { background: #DBEAFE; color: var(--blue); }
.hsm-to-avatar:nth-child(2) { background: #E0F2FE; color: #0369A1; }
.hsm-to-avatar:nth-child(3) { background: #D1FAE5; color: #059669; }
.hsm-to-avatar:nth-child(4) { background: #DBEAFE; color: #3B82F6; }
.hsm-to-avatar:nth-child(5) { background: #E0E7FF; color: #4338CA; }

.hsm-to-proof-count {
    font-size: 16px;
    color: var(--charcoal-mid);
    margin-bottom: 32px;
}
.hsm-to-proof-count strong {
    font-size: 20px;
    color: var(--charcoal);
    font-weight: 700;
}

/* Repeated CTA form */
.hsm-to-form-2 {
    max-width: 460px;
    margin: 0 auto 14px;
    display: flex;
    gap: 10px;
}

.hsm-to-trust-2 {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .hsm-to-proof { padding: 50px 20px; }
    .hsm-to-form-2 { flex-direction: column; }
}


/* ==========  SECTION 4 — FAQ  ========== */

.hsm-to-faq {
    padding: 60px 40px;
    background: var(--gray-100);
    border-top: 1px solid var(--border);
}
.hsm-to-faq-inner {
    max-width: 680px;
    margin: 0 auto;
}
.hsm-to-faq h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    text-align: center;
    color: var(--charcoal);
    margin-bottom: 36px;
}

.hsm-to-faq-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.25s ease;
}
.hsm-to-faq-item:hover { border-color: var(--border); }

.hsm-to-faq-q {
    padding: 18px 22px;
    font-size: 15px;
    font-weight: 600;
    color: var(--charcoal);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
    transition: color 0.2s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.hsm-to-faq-q:hover { color: var(--charcoal); }
.hsm-to-faq-q svg {
    width: 20px; height: 20px;
    flex-shrink: 0;
    color: var(--charcoal-light);
    transition: transform 0.3s ease, color 0.2s ease;
}
.hsm-to-faq-item.open .hsm-to-faq-q svg {
    transform: rotate(180deg);
    color: var(--charcoal-light);
}

.hsm-to-faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
}
.hsm-to-faq-item.open .hsm-to-faq-a {
    max-height: 300px;
}
.hsm-to-faq-a-inner {
    padding: 0 22px 18px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--charcoal-mid);
}

@media (max-width: 600px) {
    .hsm-to-faq { padding: 50px 20px; }
}


/* ==========  SUCCESS STATE (overlays hero form)  ========== */

.hsm-to-success { display: none; }
.hsm-to-success.active { display: block; animation: hsmFadeUp 0.5s var(--ease); }

.hsm-to-success-icon {
    width: 68px; height: 68px;
    background: var(--green-pale);
    border: 1px solid #C6F6D5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: var(--green);
    animation: hsmSuccessPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}
@keyframes hsmSuccessPop {
    from { opacity: 0; transform: scale(0.4); }
    to   { opacity: 1; transform: scale(1); }
}
.hsm-to-success-icon svg { width: 32px; height: 32px; }

.hsm-to-success h2 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 500;
    color: var(--charcoal);
    margin-bottom: 8px;
}
.hsm-to-success p {
    font-size: 16px;
    color: var(--charcoal-mid);
    line-height: 1.6;
    margin-bottom: 6px;
}
.hsm-to-success .hsm-to-success-pos {
    font-size: 14px;
    color: var(--blue);
    font-weight: 600;
    margin-bottom: 24px;
}
.hsm-to-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--gray-100);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--charcoal-mid);
    transition: all 0.2s ease;
}
.hsm-to-back:hover {
    background: var(--blue-pale);
    border-color: var(--blue);
    color: var(--blue);
    transform: translateY(-1px);
}
.hsm-to-back svg { width: 16px; height: 16px; }
