/* ============================================================================
 * MSDMART NETWORK MARKETING — Corporate Blue, White & Red Auth Stylesheet
 * Dedicated layout for /user/register.php, /user/login.php, /user/forgot-password.php
 * ============================================================================ */

:root {
    --auth-navy: #0a2263;
    --auth-royal: #1649c9;
    --auth-blue: #1d63ff;
    --auth-blue-dark: #0f3ea8;
    --auth-red: #dc2626;
    --auth-red-dark: #b91c1c;
    --auth-gold: #facc15;
    --auth-amber: #f59e0b;
    --auth-white: #ffffff;
    --auth-ink: #0f172a;
    --auth-muted: #64748b;
    --auth-border: #d5dfef;
    --auth-bg: #eef4ff;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body.msd-auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--auth-ink);
    background: linear-gradient(155deg, #e7f0ff 0%, #f8fbff 48%, #e2eeff 100%);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.font-display {
    font-family: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
}

.font-mono-tabular {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
    font-variant-numeric: tabular-nums;
}

/* Ambient Blue Diagonal Corner Waves */
.msd-auth-bg-waves {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.msd-auth-bg-waves::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -140px;
    width: 560px;
    height: 460px;
    background: radial-gradient(circle at 68% 32%, rgba(22, 73, 201, 0.24) 0%, rgba(14, 165, 233, 0.14) 42%, transparent 72%);
    transform: rotate(-16deg);
}

.msd-auth-bg-waves::after {
    content: "";
    position: absolute;
    bottom: -140px;
    left: -120px;
    width: 520px;
    height: 440px;
    background: radial-gradient(circle at 30% 70%, rgba(10, 34, 99, 0.22) 0%, rgba(29, 99, 255, 0.12) 45%, transparent 74%);
}

/* Top Compact Bar */
.msd-auth-topbar {
    position: relative;
    z-index: 5;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid rgba(22, 73, 201, 0.1);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(10px);
}

.msd-auth-topbar-inner {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.msd-auth-back-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.msd-auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--auth-navy);
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.18s ease;
}

.msd-auth-back-link:hover {
    color: var(--auth-red);
}

.msd-auth-nav-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.msd-top-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.42rem 0.95rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    border: 1.5px solid transparent;
    transition: all 0.18s ease;
}

.msd-top-btn-outline {
    color: var(--auth-navy);
    border-color: rgba(22, 73, 201, 0.28);
    background: #ffffff;
}

.msd-top-btn-outline:hover,
.msd-top-btn-outline.active {
    background: var(--auth-navy);
    border-color: var(--auth-navy);
    color: #ffffff;
}

.msd-top-btn-red {
    background: var(--auth-red);
    border-color: var(--auth-red);
    color: #ffffff;
}

.msd-top-btn-red:hover,
.msd-top-btn-red.active {
    background: var(--auth-red-dark);
    border-color: var(--auth-red-dark);
    color: #ffffff;
}

/* Main Stage */
.msd-auth-main {
    position: relative;
    z-index: 2;
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 1rem 2.25rem;
}

/* Brand Header Lockup */
.msd-brand-lockup {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.25rem;
}

.msd-brand-row {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
}

.msd-brand-globe {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    filter: drop-shadow(0 6px 14px rgba(10, 34, 99, 0.18));
}

.msd-brand-wordmark {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
}

.msd-brand-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: clamp(1.85rem, 3.8vw, 2.55rem);
    letter-spacing: -0.02em;
    line-height: 1;
}

.msd-brand-title .msd-part-blue {
    color: var(--auth-navy);
}

.msd-brand-title .msd-part-red {
    color: var(--auth-red);
}

.msd-brand-sub {
    margin-top: 0.22rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(0.68rem, 1.4vw, 0.86rem);
    font-weight: 800;
    letter-spacing: 0.16em;
    color: var(--auth-navy);
    text-transform: uppercase;
}

.msd-brand-tagline {
    margin-top: 0.42rem;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-family: 'Plus Jakarta Sans', Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--auth-navy);
}

.msd-brand-tagline::before,
.msd-brand-tagline::after {
    content: "";
    width: 44px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--auth-red));
}

.msd-brand-tagline::after {
    background: linear-gradient(90deg, var(--auth-red), transparent);
}

/* ==========================================================================
 * SIGNUP SPLIT CARD (/user/register.php)
 * ========================================================================== */
.msd-signup-shell {
    width: 100%;
    max-width: 1040px;
    background: #ffffff;
    border-radius: 22px;
    border: 1px solid rgba(22, 73, 201, 0.14);
    box-shadow: 0 26px 60px -14px rgba(10, 34, 99, 0.22);
    overflow: hidden;
    display: grid;
    grid-template-columns: 44% 56%;
}

/* Left Promotional Blue Panel */
.msd-promo-aside {
    position: relative;
    background: linear-gradient(165deg, #071d59 0%, #103ea1 52%, #082163 100%);
    color: #ffffff;
    padding: 1.75rem 1.6rem 1.4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.msd-promo-aside::before {
    content: "";
    position: absolute;
    top: -70px;
    left: -60px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.msd-promo-aside::after {
    content: "";
    position: absolute;
    bottom: -95px;
    right: -85px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.42) 0%, transparent 72%);
    pointer-events: none;
}

.msd-promo-top {
    position: relative;
    z-index: 2;
}

.msd-promo-hero-grid {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.25rem;
}

.msd-promo-portrait {
    position: relative;
    width: 112px;
    height: 132px;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 26px rgba(3, 12, 42, 0.42);
    background: #0e2e85;
}

.msd-promo-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.msd-promo-headline h2 {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.55rem;
    line-height: 1.15;
    color: #ffffff;
}

.msd-promo-headline h2 span {
    display: block;
    color: var(--auth-gold);
    font-size: 1.72rem;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.msd-promo-sublead {
    margin: 0.55rem 0 0;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.38;
    color: #dbeafe;
}

.msd-promo-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.05));
    margin: 0.25rem 0 1rem;
}

.msd-promo-features {
    list-style: none;
    margin: 0 0 1.2rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.78rem;
}

.msd-promo-feature {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.5rem 0.65rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(4px);
}

.msd-feat-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    color: #ffffff;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.msd-feat-badge.blue { background: linear-gradient(135deg, #2563eb, #1e40af); }
.msd-feat-badge.green { background: linear-gradient(135deg, #22c55e, #15803d); }
.msd-feat-badge.purple { background: linear-gradient(135deg, #c026d3, #7e22ce); }
.msd-feat-badge.amber { background: linear-gradient(135deg, #f59e0b, #d97706); }

.msd-feat-copy strong {
    display: block;
    font-size: 0.96rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.msd-feat-copy span {
    display: block;
    font-size: 0.76rem;
    color: #bfdbfe;
    margin-top: 0.1rem;
}

/* Golden Ribbon Strip */
.msd-gold-ribbon-wrap {
    position: relative;
    z-index: 2;
    margin: 0.4rem -1.6rem 0.9rem;
    padding: 0.65rem 1.5rem;
    background: linear-gradient(90deg, #e08d00 0%, #fde047 50%, #e08d00 100%);
    color: #0b225e;
    text-align: center;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
    transform: rotate(-1.5deg);
}

.msd-gold-ribbon-wrap span {
    font-family: 'Plus Jakarta Sans', Georgia, serif;
    font-style: italic;
    font-weight: 800;
    font-size: 1.18rem;
    letter-spacing: 0.03em;
}

.msd-promo-footer-globe {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.35rem;
    font-size: 0.78rem;
    color: #dbeafe;
}

.msd-promo-trust-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
}

/* Right Signup Form Column */
.msd-signup-form-col {
    padding: 1.75rem 2rem 1.85rem;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.msd-navy-form-header {
    background: linear-gradient(135deg, #0b2467 0%, #1545b5 100%);
    color: #ffffff;
    border-radius: 14px;
    padding: 0.95rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.15rem;
    box-shadow: 0 10px 22px -6px rgba(11, 36, 103, 0.35);
}

.msd-navy-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #ffffff;
    flex-shrink: 0;
}

.msd-navy-form-header h1 {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.28rem;
    line-height: 1.2;
}

.msd-navy-form-header p {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    color: #dbeafe;
}

/* Form Controls */
.msd-auth-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.32rem;
}

.msd-req-star {
    color: var(--auth-red);
}

.msd-input-box {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--auth-border);
    border-radius: 11px;
    background: #ffffff;
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.msd-input-box:focus-within {
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 3.5px rgba(29, 99, 255, 0.14);
}

.msd-input-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.78rem 0 0.9rem;
    color: #475569;
    font-size: 1rem;
    background: transparent;
    flex-shrink: 0;
}

.msd-input-box input,
.msd-input-box select {
    flex: 1 1 0%;
    min-width: 0;
    width: auto;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    padding: 0.68rem 0.65rem 0.68rem 0;
    font-size: 0.95rem;
    color: var(--auth-ink);
    min-height: 44px;
}

.msd-input-box input::placeholder {
    color: #64748b;
}

.msd-pw-eye-btn {
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
    min-width: 42px;
    border: 0;
    background: transparent;
    padding: 0 0.8rem;
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.msd-pw-eye-btn i {
    pointer-events: none;
}

.msd-pw-eye-btn:hover {
    color: var(--auth-navy);
    background-color: #f1f5f9;
}

.msd-verify-sponsor-btn {
    border: 0;
    border-left: 1px solid var(--auth-border);
    background: #f1f5f9;
    color: var(--auth-navy);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0 0.9rem;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.msd-verify-sponsor-btn:hover {
    background: #dbeafe;
    color: var(--auth-blue-dark);
}

/* Password Meter */
.msd-pw-meter {
    height: 5px;
    border-radius: 99px;
    background: #e2e8f0;
    overflow: hidden;
    margin-top: 0.42rem;
}

.msd-pw-meter-fill {
    height: 100%;
    width: 0%;
    transition: width 0.25s ease, background-color 0.25s ease;
}

.msd-field-hint {
    font-size: 0.77rem;
    margin-top: 0.28rem;
    min-height: 1.05rem;
}

/* Terms Checkbox */
.msd-terms-row {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.86rem;
    color: #334155;
    margin: 0.85rem 0 1rem;
}

.msd-terms-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 0.12rem;
    accent-color: var(--auth-blue);
    cursor: pointer;
    flex-shrink: 0;
}

.msd-terms-row a {
    color: var(--auth-blue);
    font-weight: 600;
    text-decoration: none;
}

.msd-terms-row a:hover {
    text-decoration: underline;
    color: var(--auth-red);
}

/* Primary Royal-Blue CTA Button */
.msd-btn-primary {
    width: 100%;
    border: 0;
    border-radius: 11px;
    padding: 0.82rem 1.25rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #ffffff;
    background: linear-gradient(180deg, #1f6bff 0%, #0b46d4 100%);
    box-shadow: 0 10px 22px -6px rgba(15, 62, 168, 0.5);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.msd-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px -6px rgba(15, 62, 168, 0.55);
    filter: brightness(1.04);
}

.msd-btn-primary:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.msd-auth-switch-link {
    text-align: center;
    margin-top: 1rem;
    padding-top: 0.9rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.9rem;
    color: #334155;
}

.msd-auth-switch-link a {
    color: var(--auth-blue);
    font-weight: 700;
    text-decoration: none;
    margin-left: 0.25rem;
}

.msd-auth-switch-link a:hover {
    color: var(--auth-red);
    text-decoration: underline;
}

/* ==========================================================================
 * LOGIN & RECOVERY CARD (/user/login.php, /user/forgot-password.php)
 * ========================================================================== */
.msd-login-outer {
    width: 100%;
    max-width: 540px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, #eef4ff 100%);
    border-radius: 24px;
    border: 1.5px solid rgba(22, 73, 201, 0.16);
    box-shadow: 0 26px 60px -14px rgba(10, 34, 99, 0.22);
    overflow: hidden;
}

.msd-login-inner {
    margin: 1.35rem 1.35rem 0;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(22, 73, 201, 0.12);
    box-shadow: 0 12px 28px -8px rgba(10, 34, 99, 0.1);
    padding: 1.75rem 1.75rem 1.55rem;
}

.msd-login-lock-circle {
    width: 68px;
    height: 68px;
    margin: 0 auto 0.9rem;
    border-radius: 50%;
    background: linear-gradient(145deg, #2563eb 0%, #0e44cf 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.1), 0 10px 22px rgba(14, 68, 207, 0.35);
}

.msd-login-lock-circle.red-accent {
    background: linear-gradient(145deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.1), 0 10px 22px rgba(185, 28, 28, 0.3);
}

.msd-login-heading {
    text-align: center;
    margin-bottom: 1.25rem;
}

.msd-login-heading h1 {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.55rem;
    color: var(--auth-navy);
}

.msd-login-heading p {
    margin: 0.3rem 0 0;
    font-size: 0.9rem;
    color: #475569;
}

.msd-login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0.75rem 0 1.1rem;
    font-size: 0.88rem;
}

.msd-remember-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    cursor: pointer;
    color: #334155;
    font-weight: 500;
}

.msd-remember-label input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--auth-blue);
    cursor: pointer;
}

.msd-forgot-link {
    color: var(--auth-blue);
    font-weight: 600;
    text-decoration: none;
}

.msd-forgot-link:hover {
    color: var(--auth-red);
    text-decoration: underline;
}

/* Bottom Wave Banner inside Login Card */
.msd-login-bottom-wave {
    position: relative;
    margin-top: 1rem;
    background: linear-gradient(135deg, #071e5d 0%, #1041aa 58%, #0a256e 100%);
    color: #ffffff;
    padding: 1.35rem 1.25rem 1.15rem;
    text-align: center;
    overflow: hidden;
}

.msd-login-bottom-wave::before {
    content: "";
    position: absolute;
    top: -18px;
    left: -5%;
    width: 110%;
    height: 36px;
    background: #eef4ff;
    border-bottom-left-radius: 55% 100%;
    border-bottom-right-radius: 55% 100%;
}

.msd-wave-silhouettes {
    position: relative;
    z-index: 2;
    margin-top: 0.25rem;
    opacity: 0.85;
}

.msd-wave-slogan {
    position: relative;
    z-index: 2;
    margin: 0.2rem 0 0;
    font-family: 'Plus Jakarta Sans', Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: 1.08rem;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.msd-auth-footer-note {
    position: relative;
    z-index: 2;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--auth-muted);
}

.msd-auth-footer-note a {
    color: var(--auth-navy);
    font-weight: 600;
    text-decoration: none;
}

.msd-auth-footer-note a:hover {
    color: var(--auth-red);
}

/* Responsive Breakpoints */
@media (max-width: 991.98px) {
    .msd-signup-shell {
        grid-template-columns: 1fr;
        max-width: 600px;
    }

    .msd-promo-aside {
        padding: 1.45rem 1.35rem 1.2rem;
    }

    .msd-promo-features {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .msd-gold-ribbon-wrap {
        transform: none;
        margin: 0.25rem -1.35rem 0.65rem;
    }
}

@media (max-width: 575.98px) {
    .msd-auth-main {
        padding: 1rem 0.75rem 1.75rem;
    }

    .msd-promo-hero-grid {
        grid-template-columns: 84px 1fr;
        gap: 0.85rem;
    }

    .msd-promo-portrait {
        width: 84px;
        height: 102px;
    }

    .msd-promo-headline h2 {
        font-size: 1.28rem;
    }

    .msd-promo-headline h2 span {
        font-size: 1.42rem;
    }

    .msd-promo-features {
        grid-template-columns: 1fr;
    }

    .msd-signup-form-col {
        padding: 1.25rem 1.15rem 1.4rem;
    }

    .msd-login-inner {
        margin: 0.9rem 0.9rem 0;
        padding: 1.35rem 1.15rem 1.25rem;
    }

    .msd-input-box input,
    .msd-input-box select {
        font-size: 16px;
    }
}
