/* =============================================================================
   Jaihind News — Auth / Subscribe popup
   Tokens come from auth.css. Brand accents: Royal Blue #0038AD + Impact Red #C60C30.
   ============================================================================= */

.jhm {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--auth-space-6);
    font-family: var(--auth-font);
}

.jhm[hidden] {
    display: none;
}

.jhm__scrim {
    position: absolute;
    inset: 0;
    background: rgba(9, 12, 18, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: jhm-fade 0.22s var(--auth-ease);
}

.jhm__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 452px;
    max-height: calc(100vh - var(--auth-space-11));
    overflow: hidden auto;
    background: var(--auth-surface);
    border-radius: 16px;
    box-shadow: 0 32px 80px rgba(9, 12, 18, 0.32);
    padding: var(--auth-space-7) var(--auth-space-7) var(--auth-space-6);
    animation: jhm-rise 0.28s var(--auth-ease);
    overscroll-behavior: contain;
}

.jhm--wide .jhm__dialog {
    max-width: 860px;
}

.jhm__dialog:focus {
    outline: none;
}

/* Animated brand blue <-> red top border */
.jhm__edge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        #0038AD 0%,
        #0038AD 18%,
        #C60C30 42%,
        #C60C30 58%,
        #0038AD 82%,
        #0038AD 100%
    );
    background-size: 220% 100%;
    animation: jhm-edge 4.5s linear infinite;
}

@keyframes jhm-edge {
    0% { background-position: 0% 50%; }
    100% { background-position: 220% 50%; }
}

@keyframes jhm-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes jhm-rise {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.jhm__close {
    position: absolute;
    top: var(--auth-space-4);
    right: var(--auth-space-4);
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--auth-line);
    border-radius: 999px;
    background: var(--auth-surface);
    color: var(--auth-ink-soft);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: border-color 0.18s var(--auth-ease), color 0.18s var(--auth-ease);
}

.jhm__close:hover {
    border-color: var(--auth-line-strong);
    color: var(--auth-ink);
}

.jhm__close:focus-visible {
    outline: none;
    box-shadow: var(--auth-focus-ring);
}

/* ----------------------------------------------------------------- head/tabs */

.jhm__head {
    display: flex;
    flex-direction: column;
    gap: var(--auth-space-5);
    margin-bottom: var(--auth-space-6);
}

.jhm__logo {
    width: 132px;
    height: auto;
}

.jhm__tabs {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-bottom: 1px solid var(--auth-line);
}

.jhm--subscribe .jhm__tabs,
.jhm--done .jhm__tabs {
    display: none;
}

.jhm__tab {
    border: 0;
    background: none;
    padding: 0 0 var(--auth-space-3);
    font-family: inherit;
    font-size: var(--auth-fs-secondary);
    font-weight: var(--auth-fw-semibold);
    letter-spacing: 0.02em;
    color: var(--auth-muted);
    cursor: pointer;
    transition: color 0.18s var(--auth-ease);
}

.jhm__tab.is-active {
    color: var(--auth-ink);
}

.jhm__tab:focus-visible {
    outline: none;
    color: var(--auth-ink);
    box-shadow: var(--auth-focus-ring);
    border-radius: 6px;
}

.jhm__tab-ink {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, #0038AD 0%, #0038AD 46%, #C60C30 54%, #C60C30 100%);
    transition: transform 0.26s var(--auth-ease);
}

.jhm--signup .jhm__tab-ink {
    transform: translateX(100%);
}

/* --------------------------------------------------------------------- views */

.jhm__view[hidden] {
    display: none;
}

.jhm__intro {
    margin-bottom: var(--auth-space-5);
}

.jhm__kicker {
    display: inline-flex;
    align-items: center;
    gap: var(--auth-space-2);
    font-size: var(--auth-fs-micro);
    font-weight: var(--auth-fw-bold);
    letter-spacing: var(--auth-ls-kicker);
    text-transform: uppercase;
    color: var(--auth-muted);
    margin-bottom: var(--auth-space-3);
}

/* Brand dual tick — same mark as the section headers */
.jhm__tick {
    display: inline-block;
    width: 9px;
    height: 0.95em;
    background:
        linear-gradient(#0038AD, #0038AD) left top / 3.5px 100% no-repeat,
        linear-gradient(#C60C30, #C60C30) right bottom / 3.5px 72% no-repeat;
}

.jhm__title {
    margin: 0 0 var(--auth-space-2);
    font-family: var(--auth-font-display);
    font-size: 1.75rem;
    font-weight: var(--auth-fw-semibold);
    line-height: var(--auth-lh-title);
    letter-spacing: var(--auth-ls-title);
    color: var(--auth-ink);
}

.jhm__lede {
    margin: 0;
    font-size: var(--auth-fs-secondary);
    line-height: var(--auth-lh-body);
    color: var(--auth-ink-soft);
}

.jhm__grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--auth-space-4);
}

/* -------------------------------------------------------------------- alerts */

.jhm__alert {
    margin-bottom: var(--auth-space-5);
    padding: var(--auth-space-3) var(--auth-space-4);
    border-left: 3px solid var(--auth-danger);
    border-radius: 6px;
    background: var(--auth-danger-bg);
    color: var(--auth-danger);
    font-size: var(--auth-fs-meta);
    line-height: var(--auth-lh-meta);
}

.jhm__alert[hidden] {
    display: none;
}

.jhm__alert--success {
    border-left-color: var(--auth-success);
    background: var(--auth-success-bg);
    color: var(--auth-success);
}

.jhm__alert--info {
    border-left-color: #0038AD;
    background: rgba(0, 56, 173, 0.06);
    color: #0b2f7a;
}

.jhm__verify {
    display: flex;
    flex-direction: column;
    gap: var(--auth-space-3);
    margin-bottom: var(--auth-space-5);
    padding: var(--auth-space-4);
    border: 1px solid var(--auth-line);
    border-radius: var(--auth-radius);
    background: var(--auth-warning-bg);
}

.jhm__verify[hidden] {
    display: none;
}

.jhm__verify-text,
.jhm__verify-note {
    margin: 0;
    font-size: var(--auth-fs-meta);
    line-height: var(--auth-lh-meta);
    color: var(--auth-warning);
}

.jhm__verify-note:empty {
    display: none;
}

/* ------------------------------------------------------------------ subscribe */

.jhm__locale {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--auth-space-2);
    margin-bottom: var(--auth-space-5);
    padding-bottom: var(--auth-space-4);
    border-bottom: 1px solid var(--auth-line);
    font-size: var(--auth-fs-meta);
    color: var(--auth-muted);
}

.jhm__locale[hidden] {
    display: none;
}

.jhm__locale strong {
    color: var(--auth-ink);
    font-weight: var(--auth-fw-semibold);
}

.jhm__plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
    gap: var(--auth-space-4);
}

.jhm__skeleton {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
    gap: var(--auth-space-4);
}

.jhm__skeleton span {
    display: block;
    height: 260px;
    border-radius: var(--auth-radius);
    background: linear-gradient(100deg, #f1f3f6 30%, #e7eaef 50%, #f1f3f6 70%);
    background-size: 220% 100%;
    animation: jhm-shimmer 1.3s linear infinite;
}

@keyframes jhm-shimmer {
    0% { background-position: 120% 0; }
    100% { background-position: -20% 0; }
}

.jhm__plan {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--auth-space-3);
    padding: var(--auth-space-5);
    border: 1px solid var(--auth-line);
    border-radius: var(--auth-radius);
    background: var(--auth-surface);
    transition: border-color 0.2s var(--auth-ease), box-shadow 0.2s var(--auth-ease), transform 0.2s var(--auth-ease);
}

.jhm__plan:hover {
    border-color: var(--auth-line-strong);
    box-shadow: 0 14px 34px rgba(9, 12, 18, 0.08);
    transform: translateY(-2px);
}

.jhm__plan--popular {
    border-color: rgba(0, 56, 173, 0.36);
}

.jhm__plan--popular::before {
    content: "";
    position: absolute;
    top: 0;
    left: var(--auth-space-5);
    right: var(--auth-space-5);
    height: 2px;
    background: linear-gradient(90deg, #0038AD, #C60C30);
}

.jhm__plan--current {
    background: var(--auth-canvas);
}

.jhm__ribbon {
    align-self: flex-start;
    padding: 3px var(--auth-space-2);
    border-radius: 3px;
    font-size: var(--auth-fs-micro);
    font-weight: var(--auth-fw-bold);
    letter-spacing: var(--auth-ls-micro);
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #0038AD 0%, #0038AD 45%, #C60C30 55%, #C60C30 100%);
}

.jhm__ribbon--current {
    background: var(--auth-success);
}

.jhm__plan-name {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: var(--auth-fw-semibold);
    line-height: var(--auth-lh-label);
    color: var(--auth-ink);
}

.jhm__plan-desc {
    margin: 0;
    font-size: var(--auth-fs-meta);
    line-height: var(--auth-lh-meta);
    color: var(--auth-muted);
}

.jhm__plan-price {
    margin: var(--auth-space-1) 0 0;
    font-family: var(--auth-font-display);
    font-size: 1.875rem;
    font-weight: var(--auth-fw-semibold);
    line-height: 1.1;
    color: var(--auth-ink);
}

.jhm__plan-price span {
    font-family: var(--auth-font);
    font-size: var(--auth-fs-meta);
    font-weight: var(--auth-fw-medium);
    color: var(--auth-muted);
}

.jhm__plan-trial {
    margin: 0;
    font-size: var(--auth-fs-micro);
    font-weight: var(--auth-fw-semibold);
    letter-spacing: var(--auth-ls-micro);
    text-transform: uppercase;
    color: #0038AD;
}

.jhm__plan-features {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--auth-space-2);
    font-size: var(--auth-fs-meta);
    line-height: var(--auth-lh-meta);
    color: var(--auth-ink-soft);
}

.jhm__plan-features li {
    position: relative;
    padding-left: var(--auth-space-5);
}

.jhm__plan-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 10px;
    height: 2px;
    background: linear-gradient(90deg, #0038AD, #C60C30);
}

.jhm__plan-cta {
    margin-top: auto;
    padding-top: var(--auth-space-3);
}

.jhm__plan-note {
    margin: var(--auth-space-2) 0 0;
    font-size: var(--auth-fs-micro);
    color: var(--auth-muted);
}

.jhm__status {
    margin: var(--auth-space-4) 0 0;
    font-size: var(--auth-fs-meta);
    color: var(--auth-ink-soft);
    min-height: 1.2em;
}

.jhm__secure {
    display: flex;
    flex-wrap: wrap;
    gap: var(--auth-space-2) var(--auth-space-5);
    margin: var(--auth-space-5) 0 0;
    padding: var(--auth-space-4) 0 0;
    border-top: 1px solid var(--auth-line);
    list-style: none;
    font-size: var(--auth-fs-micro);
    color: var(--auth-muted);
}

.jhm__secure li {
    display: inline-flex;
    align-items: center;
    gap: var(--auth-space-2);
}

.jhm__empty {
    grid-column: 1 / -1;
    padding: var(--auth-space-7) var(--auth-space-5);
    border: 1px dashed var(--auth-line-strong);
    border-radius: var(--auth-radius);
    text-align: center;
    font-size: var(--auth-fs-meta);
    color: var(--auth-muted);
}

/* -------------------------------------------------------------------- success */

.jhm__done {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--auth-space-4);
    text-align: center;
    padding: var(--auth-space-6) 0 var(--auth-space-2);
}

.jhm__done-mark {
    width: 56px;
    height: 56px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    font-size: 1.5rem;
    color: var(--auth-success);
    background: var(--auth-success-bg);
}

.jhm__done .jh-btn {
    max-width: 260px;
}

/* ----------------------------------------------------------------- responsive */

@media (max-width: 767.98px) {
    .jhm {
        padding: 0;
        align-items: flex-end;
    }

    .jhm__dialog,
    .jhm--wide .jhm__dialog {
        max-width: none;
        max-height: 94vh;
        border-radius: 18px 18px 0 0;
        padding: var(--auth-space-6) var(--auth-space-5) var(--auth-space-7);
        animation: jhm-sheet 0.3s var(--auth-ease);
    }

    .jhm__title {
        font-size: 1.5rem;
    }

    .jhm__grid2 {
        grid-template-columns: 1fr;
    }

    .jhm__plans {
        grid-template-columns: 1fr;
    }

    .jhm__skeleton {
        grid-template-columns: 1fr;
    }

    .jhm__skeleton span:last-child {
        display: none;
    }
}

@keyframes jhm-sheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .jhm__scrim,
    .jhm__dialog,
    .jhm__skeleton span {
        animation: none;
    }

    .jhm__edge {
        animation: none;
        background-position: 40% 50%;
    }

    .jhm__tab-ink,
    .jhm__plan {
        transition: none;
    }
}

/* Body scroll lock while the popup is open */
body.jhm-open {
    overflow: hidden;
}
