/* ============================================================
   Mou3jam Auth Pages Styling
   Login, Registration, Password Reset
   ============================================================ */

/* Toast notification container */
.m3j-toast-container {
    z-index: 9999;
    min-width: 360px;
    max-width: 520px;
}

.m3j-toast-container .alert-danger {
    background: #f8d7da;
    color: #842029;
}

.m3j-toast-container .alert-success {
    background: #d1e7dd;
    color: #0f5132;
}

.m3j-toast-container .alert-info {
    background: #cff4fc;
    color: #055160;
}

.m3j-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--m3j-gradient, linear-gradient(135deg, #1E293B 0%, #64748B 100%));
    position: relative;
    overflow: hidden;
}

.m3j-auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.12) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(255,255,255,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.m3j-auth-card {
    background: var(--m3j-card-bg, #fff);
    border-radius: var(--m3j-radius-lg, 1rem);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 480px;
    padding: 2.5rem;
    position: relative;
    z-index: 1;
}

.m3j-auth-card.wide {
    max-width: 640px;
}

.m3j-auth-card.extra-wide {
    max-width: 800px;
}

.m3j-auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.m3j-auth-logo .logo-icon {
    width: 56px;
    height: 56px;
    background: var(--m3j-gradient);
    border-radius: var(--m3j-radius, 0.75rem);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.m3j-auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--m3j-text, #1E293B);
    margin: 0;
}

.m3j-auth-logo p {
    font-size: 0.875rem;
    color: var(--m3j-text-secondary, #64748B);
    margin: 0.5rem 0 0;
}

.m3j-auth-card .form-label {
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--m3j-text-secondary, #64748B);
    margin-bottom: 0.375rem;
}

.m3j-auth-card .form-control {
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    border-radius: var(--m3j-radius-sm, 0.5rem);
    border: 1px solid var(--m3j-border, #E2E8F0);
}

.m3j-auth-card .form-control:focus {
    border-color: var(--m3j-primary, #1f2b58);
    box-shadow: 0 0 0 3px var(--m3j-primary-bg, rgba(31, 43, 88,0.08));
}

.m3j-auth-card .btn-primary {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--m3j-radius-sm, 0.5rem);
    background: var(--m3j-primary, #1f2b58);
    border: none;
    transition: var(--m3j-transition);
}

.m3j-auth-card .btn-primary:hover {
    background: var(--m3j-primary-hover, #172147);
    transform: translateY(-1px);
    box-shadow: var(--m3j-shadow-md);
}

.m3j-auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--m3j-text-secondary, #64748B);
}

.m3j-auth-footer a {
    color: var(--m3j-primary, #1f2b58);
    text-decoration: none;
    font-weight: 500;
}

.m3j-auth-footer a:hover {
    text-decoration: underline;
}

.m3j-auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--m3j-text-muted, #94A3B8);
    font-size: 0.8125rem;
}

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

/* Error/success messages on auth pages */
.m3j-auth-card .alert {
    border-radius: var(--m3j-radius-sm, 0.5rem);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

/* jQuery Steps wizard override for login2.php */
.m3j-auth-card .wizard > .steps > ul > li {
    width: 25%;
}

.m3j-auth-card .wizard > .steps a,
.m3j-auth-card .wizard > .steps a:hover,
.m3j-auth-card .wizard > .steps a:active {
    padding: 0.75rem 1rem;
    border-radius: var(--m3j-radius-sm);
    font-size: 0.875rem;
}

.m3j-auth-card .wizard > .steps .current a,
.m3j-auth-card .wizard > .steps .current a:hover {
    background: var(--m3j-primary, #1f2b58);
    color: #fff;
}

.m3j-auth-card .wizard > .steps .done a,
.m3j-auth-card .wizard > .steps .done a:hover {
    background: var(--m3j-primary-bg, rgba(31, 43, 88, 0.08));
    color: var(--m3j-primary, #1f2b58);
}

.m3j-auth-card .wizard > .content {
    background: transparent;
    min-height: auto;
    padding: 1rem 0;
}

.m3j-auth-card .wizard > .actions a {
    background: var(--m3j-primary, #1f2b58);
    border-radius: var(--m3j-radius-sm);
    font-weight: 500;
    padding: 0.5rem 1.5rem;
}

.m3j-auth-card .wizard > .actions a:hover {
    background: var(--m3j-primary-hover, #172147);
}

/* Language switcher on auth pages */
.m3j-auth-lang {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
}

[dir="rtl"] .m3j-auth-lang {
    right: auto;
    left: 1.5rem;
}

.m3j-auth-lang .btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    backdrop-filter: blur(4px);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.m3j-auth-lang .btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Cookie bubble override */
.cookieBubble {
    border-radius: var(--m3j-radius, 0.75rem) !important;
    box-shadow: var(--m3j-shadow-lg) !important;
}

/* Responsive */
@media (max-width: 575.98px) {
    .m3j-auth-card {
        padding: 1.75rem 1.25rem;
    }

    .m3j-auth-card .wizard > .steps > ul > li {
        width: 50%;
    }
}

/* ============================================================
   Landing Page Variant
   For multi-section pages (login2, signup2)
   ============================================================ */

.m3j-auth-page:has(.m3j-landing) {
    display: block;
    padding: 0;
    background: var(--m3j-page-bg, #F8FAFC);
    overflow-x: hidden;
    overflow-y: auto;
}

.m3j-auth-page:has(.m3j-landing)::before {
    display: none;
}

/* Fallback for browsers without :has() support */
.m3j-auth-page.m3j-auth-landing {
    display: block !important;
    padding: 0 !important;
    background: var(--m3j-page-bg, #F8FAFC) !important;
    overflow-x: hidden;
    overflow-y: auto;
}

.m3j-auth-page.m3j-auth-landing::before {
    display: none;
}

/* Landing hero section */
.m3j-landing-hero {
    background: var(--m3j-gradient, linear-gradient(135deg, #1E293B 0%, #64748B 100%));
    color: #fff;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.m3j-landing-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.1) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 80%, rgba(255,255,255,0.06) 0%, transparent 50%);
    pointer-events: none;
}

.m3j-landing-hero .container {
    position: relative;
    z-index: 1;
}

.m3j-landing-hero a {
    color: rgba(255,255,255,0.85);
}

.m3j-landing-hero a:hover {
    color: #fff;
}

.m3j-landing-hero .form-control {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    backdrop-filter: blur(4px);
}

.m3j-landing-hero .form-control::placeholder {
    color: rgba(255,255,255,0.6);
}

.m3j-landing-hero .form-control:focus {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
    color: #fff;
}

/* Pricing cards */
.m3j-pricing-card {
    border: none !important;
    border-radius: var(--m3j-radius-lg, 1rem);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.m3j-pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,.1);
}

.m3j-pricing-head {
    background: var(--m3j-gradient, linear-gradient(135deg, #1E293B 0%, #64748B 100%));
    color: #fff;
    padding: 2rem 1.5rem;
    text-align: center;
}

.m3j-pricing-head h5 {
    color: rgba(255,255,255,0.9);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.m3j-pricing-head .display-price {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.2;
}

.m3j-pricing-head .display-price small {
    font-size: 1.25rem;
    vertical-align: super;
}

.m3j-pricing-head .price-subtitle {
    font-size: 0.875rem;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.m3j-pricing-head .price-note {
    font-size: 0.8125rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

.m3j-pricing-body {
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.m3j-pricing-body .btn {
    margin-top: auto;
}

.m3j-pricing-body ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.m3j-pricing-body li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--m3j-border, #E2E8F0);
    color: var(--m3j-text-secondary, #64748B);
    font-size: 0.9375rem;
}

.m3j-pricing-body li:last-child {
    border-bottom: none;
}

/* Package selector radio groups */
.m3j-package-option {
    position: relative;
    padding: 1.25rem 1rem;
    border: 2px solid var(--m3j-border, #E2E8F0);
    border-radius: var(--m3j-radius, 0.75rem);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: #fff;
}

.m3j-package-option:hover {
    border-color: var(--m3j-primary, #1f2b58);
}

.m3j-package-option:has(input:checked) {
    border-color: var(--m3j-primary, #1f2b58);
    background: rgba(31, 43, 88, 0.04);
    box-shadow: 0 0 0 3px rgba(31, 43, 88, 0.1);
}

.m3j-package-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.m3j-package-option .package-label {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--m3j-text, #1E293B);
    display: block;
}

.m3j-package-option .package-price {
    font-size: 0.8125rem;
    color: var(--m3j-primary, #1f2b58);
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Promo Code Bar */
.m3j-promo-bar {
    display: flex;
    align-items: center;
    width: 100%;
    background: var(--m3j-page-bg, #F8FAFC);
    border-radius: var(--m3j-radius, 0.75rem);
    border: 2px dashed var(--m3j-border, #E2E8F0);
    padding: 0.3rem;
    transition: border-color 0.2s, background 0.2s;
}

.m3j-promo-bar:focus-within {
    border-color: var(--m3j-primary, #1f2b58);
    border-style: solid;
    background: #fff;
}

.m3j-promo-bar > i {
    color: var(--m3j-primary, #1f2b58);
    font-size: 0.9rem;
    flex-shrink: 0;
    margin: 0 0.6rem 0 0.75rem;
    opacity: 0.5;
}

.m3j-promo-bar:focus-within > i {
    opacity: 1;
}

.m3j-promo-bar .m3j-promo-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    padding: 0.5rem 0.5rem;
    outline: none;
}

.m3j-promo-bar .m3j-promo-input:focus {
    box-shadow: none;
    outline: none;
}

.m3j-promo-bar .m3j-apply-promo-btn {
    flex-shrink: 0;
    border: none;
    border-radius: calc(var(--m3j-radius, 0.75rem) - 4px);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    white-space: nowrap;
    background: var(--m3j-primary, #1f2b58);
    color: #fff;
    transition: background 0.2s;
    cursor: pointer;
}

.m3j-promo-bar .m3j-apply-promo-btn:hover {
    background: var(--m3j-primary-dark, #161f40);
}

[dir="rtl"] .m3j-promo-bar > i {
    margin: 0 0.75rem 0 0.6rem;
}

/* Form cards inside wizard steps */
.m3j-landing .wizard .card .card-body {
    padding: 2rem;
}

/* Checkout summary */
.m3j-checkout-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--m3j-border, #E2E8F0);
    font-size: 0.9375rem;
}

.m3j-checkout-row:last-child {
    border-bottom: none;
}

.m3j-checkout-row.total {
    font-weight: 700;
    font-size: 1.125rem;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--m3j-text, #1E293B);
    border-bottom: none;
}

/* Wizard step sections spacing */
.m3j-landing .wizard > .content > .body > .row {
    padding: 1rem 0;
}

/* jQuery Steps wizard on landing pages — hide step numbers */
.m3j-landing .wizard > .steps .number {
    display: none;
}

.m3j-landing .wizard > .steps > ul > li {
    width: 20%;
    text-align: center;
}

.m3j-landing .wizard > .steps a,
.m3j-landing .wizard > .steps a:hover,
.m3j-landing .wizard > .steps a:active {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
    border-radius: var(--m3j-radius-sm, 0.5rem);
}

.m3j-landing .wizard > .steps .current a,
.m3j-landing .wizard > .steps .current a:hover {
    background: var(--m3j-primary, #1f2b58);
    color: #fff;
}

.m3j-landing .wizard > .steps .done a,
.m3j-landing .wizard > .steps .done a:hover {
    background: var(--m3j-primary-bg, rgba(31, 43, 88, 0.08));
    color: var(--m3j-primary, #1f2b58);
}

.m3j-landing .wizard > .content {
    background: transparent;
    min-height: auto;
    padding: 1.5rem 0;
}

.m3j-landing .wizard > .content > .body {
    position: relative;
}

.m3j-landing .wizard > .content > .body ul {
    list-style: none !important;
}

/* Contact info on landing pages */
.m3j-contact-info p {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: var(--m3j-text, #1E293B);
}

.m3j-contact-info i {
    color: var(--m3j-primary, #1f2b58);
    width: 2rem;
    text-align: center;
    flex-shrink: 0;
}

/* Category nav-pills for login2 */
#dicCategoryTabs.nav-pills .nav-link {
    background: var(--m3j-card-bg, #fff) !important;
    color: var(--m3j-text-secondary, #64748B) !important;
    border: 1px solid var(--m3j-border, #E2E8F0);
    border-radius: var(--m3j-radius-pill, 50rem) !important;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center !important;
    transition: var(--m3j-transition, all 0.2s ease);
}

#dicCategoryTabs.nav-pills .nav-link:hover {
    background: var(--m3j-primary-bg, rgba(31, 43, 88, 0.08)) !important;
    color: var(--m3j-primary, #1f2b58) !important;
    border-color: var(--m3j-primary-light, #2e3f73);
}

#dicCategoryTabs.nav-pills .nav-link.active {
    background: var(--m3j-primary, #1f2b58) !important;
    color: var(--m3j-text-on-primary, #fff) !important;
    border-color: var(--m3j-primary, #1f2b58);
    box-shadow: var(--m3j-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.04));
}

/* Show more button — match dicCategoryTabs pill style */
.btn-show-more {
    background: var(--m3j-card-bg, #fff) !important;
    color: var(--m3j-text-secondary, #64748B) !important;
    border: 1px solid var(--m3j-border, #E2E8F0) !important;
    border-radius: var(--m3j-radius-pill, 50rem) !important;
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--m3j-transition, all 0.2s ease);
}

.btn-show-more:hover {
    background: var(--m3j-primary-bg, rgba(31, 43, 88, 0.08)) !important;
    color: var(--m3j-primary, #1f2b58) !important;
    border-color: var(--m3j-primary-light, #2e3f73) !important;
}

/* Dictionary cards for login2 */
.m3j-dic-card {
    border: 1px solid var(--m3j-border, #E2E8F0);
    border-radius: var(--m3j-radius, 0.75rem);
    padding: 1rem;
    text-align: center;
    height: 100%;
    transition: all 0.2s ease;
    cursor: pointer;
    background: #fff;
}

.m3j-dic-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.1);
    transform: translateY(-2px);
}

.m3j-dic-card img {
    max-width: 60%;
    height: auto;
    margin: 0.5rem 0;
}

.m3j-dic-card h6 {
    font-weight: 600;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.m3j-dic-card .text-muted {
    font-size: 0.8125rem;
}

/* Dictionary content scroll area */
.m3j-dic-content {
    max-height: 730px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

.m3j-dic-content::-webkit-scrollbar {
    width: 4px;
}

.m3j-dic-content::-webkit-scrollbar-thumb {
    background: var(--m3j-border, #E2E8F0);
    border-radius: 2px;
}

/* Fixed lang switcher on landing pages */
.m3j-auth-page:has(.m3j-landing) .m3j-auth-lang,
.m3j-auth-page.m3j-auth-landing .m3j-auth-lang {
    position: fixed;
}

/* Plan icon in pricing card header */
.m3j-plan-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    font-size: 1.25rem;
    color: #fff;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Featured / Popular pricing card */
.m3j-pricing-featured {
    position: relative;
    border: 2px solid var(--m3j-primary, #1f2b58) !important;
    transform: scale(1.04);
    z-index: 1;
}

.m3j-pricing-featured:hover {
    transform: scale(1.06);
}

.m3j-pricing-badge {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--m3j-primary, #1f2b58);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.25rem 1rem;
    border-radius: 0 0 0.5rem 0.5rem;
    white-space: nowrap;
    z-index: 2;
}

/* Step icon (form card headers) */
.m3j-step-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 0.625rem;
    background: var(--m3j-primary-bg, rgba(31, 43, 88, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--m3j-primary, #1f2b58);
    font-size: 1rem;
}

/* Section label dividers in forms */
.m3j-section-label {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--m3j-text-muted, #94A3B8);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--m3j-border-light, #F1F5F9);
    margin-bottom: 0.25rem;
}

/* Save badge on package options */
.m3j-package-option .package-save {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--m3j-success, #10B981);
    margin-top: 0.25rem;
    letter-spacing: 0.02em;
}

/* Input group icon borders */
.m3j-landing .input-group .input-group-text {
    border-color: var(--m3j-border, #E2E8F0);
}

.m3j-landing .input-group .form-control {
    border-color: var(--m3j-border, #E2E8F0);
}

.m3j-landing .input-group:focus-within .input-group-text {
    border-color: var(--m3j-primary, #1f2b58);
    color: var(--m3j-primary, #1f2b58);
}

.m3j-landing .input-group:focus-within .form-control {
    border-color: var(--m3j-primary, #1f2b58);
    box-shadow: none;
}

@media (max-width: 767.98px) {
    .m3j-landing-hero {
        padding: 2.5rem 0;
    }

    .m3j-landing .wizard > .steps > ul > li {
        width: 50%;
        text-align: center;
    }

    .m3j-dic-content {
        max-height: 500px;
    }

    .m3j-pricing-featured {
        transform: scale(1);
    }

    .m3j-pricing-featured:hover {
        transform: translateY(-4px);
    }
}
