:root {
    --mn-orange: #f5891f;
    --mn-orange-light: #ffa94d;
    --mn-orange-dark: #d96d10;
    --mn-brown: #3d2817;
    --mn-brown-dark: #1f140b;
    --mn-cream: #fdf8f1;
    --mn-cream-2: #f7eedf;
    --mn-gold: #f4b526;
    --mn-text: #2c1810;
    --mn-text-soft: #6b5949;
    --btn-primary-bg: var(--mn-orange);
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; padding: 0; }

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #fdf8f1 0%, #f7eedf 50%, #f5e6cc 100%);
    color: var(--mn-text);
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow-x: hidden;
}

/* Decorative orange glows */
body::before {
    content: '';
    position: fixed;
    top: -120px; right: -120px;
    width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(245,137,31,0.18) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
}
body::after {
    content: '';
    position: fixed;
    bottom: -150px; left: -150px;
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(244,181,38,0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
}

main {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding: 24px;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-signin {
    background: #ffffff;
    border-radius: 28px;
    box-shadow:
        0 30px 60px -20px rgba(245,137,31,0.25),
        0 12px 30px -10px rgba(0,0,0,0.08),
        0 0 0 1px rgba(245,137,31,0.1);
    overflow: hidden;
    width: 100%;
    max-width: 960px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 600px;
    padding: 0 !important;
    text-align: left !important;
}

/* LEFT panel: branding (LIGHT) */
.brand-panel {
    background:
        radial-gradient(circle at 80% 10%, rgba(245,137,31,0.15) 0%, transparent 55%),
        radial-gradient(circle at 10% 90%, rgba(244,181,38,0.18) 0%, transparent 55%),
        linear-gradient(160deg, #fff8eb 0%, #fceacb 100%);
    color: var(--mn-text);
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

/* Mongolian khee (хээ) decoration top right */
.mn-pattern {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 72px;
    height: 72px;
    opacity: 0.45;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'><g fill='none' stroke='%23d96d10' stroke-width='2.4'><rect x='6' y='6' width='68' height='68' rx='2'/><path d='M16 16h48v48H16z'/><path d='M16 26h10v10H16zM26 16v10M54 16v10M64 26h-10v10h10M16 54h10v10M26 64v-10M54 64v-10M64 54h-10v10h10M40 16v10M40 54v10M16 40h10M54 40h10M30 30h20v20H30z'/></g></svg>");
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 3;
}

/* Mountain silhouette at bottom (warm orange/brown tones) */
.mountains {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 120px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 460 110' preserveAspectRatio='none'><path fill='%23d96d10' opacity='0.25' d='M0,110 L0,68 L40,40 L80,60 L120,28 L160,55 L200,18 L250,52 L290,32 L340,62 L390,38 L430,58 L460,42 L460,110 Z'/><path fill='%233d2817' opacity='0.30' d='M0,110 L0,82 L50,62 L100,80 L150,55 L210,78 L260,60 L320,82 L380,64 L430,80 L460,72 L460,110 Z'/></svg>");
    background-size: cover;
    background-position: bottom center;
    z-index: 1;
    pointer-events: none;
}

/* Code snippet decoration top left */
.code-deco {
    position: absolute;
    top: 22px;
    left: 22px;
    font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
    font-size: 10px;
    line-height: 1.45;
    color: rgba(217,109,16,0.22);
    z-index: 1;
    user-select: none;
    pointer-events: none;
}
.code-deco div { white-space: nowrap; }

.brand-content { position: relative; z-index: 2; }

p.brand-eyebrow, .brand-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: var(--mn-orange-dark) !important;
    text-transform: uppercase;
    margin: 0 0 14px;
}

h1.brand-title, .brand-title {
    font-size: 36px !important;
    font-weight: 800 !important;
    line-height: 1.05 !important;
    margin: 0 0 14px !important;
    letter-spacing: -0.6px !important;
    color: var(--mn-brown-dark) !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.brand-subtitle {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    color: #fff !important;
    background: linear-gradient(135deg, var(--mn-orange) 0%, var(--mn-orange-dark) 100%);
    padding: 6px 14px;
    border-radius: 999px;
    margin: 0 0 22px;
    letter-spacing: 0.4px;
    box-shadow: 0 6px 14px -4px rgba(245,137,31,0.4);
}

.brand-tagline {
    font-size: 14px;
    line-height: 1.7;
    color: var(--mn-text-soft);
    margin: 0;
    max-width: 320px;
}

.brand-footer {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--mn-text);
}

.brand-footer-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(6px);
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(245,137,31,0.18);
    width: fit-content;
}

.brand-footer-row i {
    color: var(--mn-orange-dark);
    width: 14px;
    flex-shrink: 0;
}

/* RIGHT panel: login form */
.login-panel {
    padding: 56px 52px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.logo-wrap {
    text-align: center;
    margin-bottom: 26px;
}

.logo-wrap img {
    width: 104px;
    height: 104px;
    object-fit: contain;
    filter: drop-shadow(0 10px 22px rgba(245,137,31,0.3));
}

h1.login-heading, .login-heading {
    font-size: 26px !important;
    font-weight: 800 !important;
    color: var(--mn-text) !important;
    text-align: center;
    margin: 0 0 6px !important;
    letter-spacing: -0.3px;
}

.login-sub {
    font-size: 14px;
    color: var(--mn-text-soft);
    text-align: center;
    margin: 0 0 30px;
}

/* Form */
.form-floating {
    margin-bottom: 14px !important;
}
.form-floating > .form-control {
    border-radius: 14px !important;
    border: 1.5px solid #ece3d2 !important;
    height: 58px !important;
    padding: 18px 18px 6px 18px !important;
    background: #fdf9f2 !important;
    transition: all 0.2s ease;
    font-size: 15px;
}
.form-floating > .form-control:focus {
    border-color: var(--mn-orange) !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(245,137,31,0.18) !important;
    outline: none !important;
}
.form-floating > label {
    color: #a3978a !important;
    padding: 17px 18px !important;
    font-weight: 500;
}

.form-signin input[type="text"],
.form-signin input[type="password"] {
    margin-bottom: 0 !important;
    border-radius: 14px !important;
}

/* Button */
.btn-primary, .btn-lg.btn-primary {
    background: linear-gradient(135deg, var(--mn-orange) 0%, var(--mn-orange-dark) 100%) !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 16px 24px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0.4px;
    color: #fff !important;
    box-shadow: 0 10px 22px -8px rgba(245,137,31,0.6) !important;
    transition: all 0.22s ease;
    margin-top: 22px !important;
    width: 100%;
    cursor: pointer;
    text-transform: uppercase;
}
.btn-primary:hover, .btn-lg.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -8px rgba(245,137,31,0.7) !important;
    background: linear-gradient(135deg, var(--mn-orange-dark) 0%, var(--mn-orange) 100%) !important;
}
.btn-primary:active { transform: translateY(0); }

.btn-success {
    background: linear-gradient(135deg, var(--mn-gold) 0%, #c89014 100%) !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 14px 24px !important;
    font-weight: 700 !important;
    color: #2c1810 !important;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Alerts */
.alert {
    border-radius: 12px !important;
    border: none !important;
    padding: 12px 16px !important;
    font-size: 14px;
    margin-bottom: 16px;
}
.alert-danger { background: #fee2e2 !important; color: #991b1b !important; }
.alert-success { background: #d1fae5 !important; color: #065f46 !important; }

/* Footer */
#dj_version {
    text-align: center;
    color: #b8aea1 !important;
    font-size: 11px;
    margin-top: 28px !important;
    margin-bottom: 0 !important;
}

a {
    color: var(--mn-orange-dark);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--mn-orange);
    text-decoration: underline;
}

.register-link {
    text-align: center;
    font-size: 13px;
    color: var(--mn-text-soft);
    margin: 22px 0 0;
}

/* Register form scoped overrides */
.form-register {
    max-width: 1100px !important;
    min-height: auto !important;
}
.form-register .brand-panel { position: sticky; top: 0; min-height: 100%; }
.register-panel {
    padding: 36px 40px !important;
}
.register-panel .logo-wrap { margin-bottom: 16px; }
.register-panel .logo-wrap img { width: 80px; height: 80px; }
.register-panel .login-heading { font-size: 22px !important; margin-bottom: 4px !important; }
.register-panel .login-sub { margin-bottom: 18px; }
.register-form-wrap .mb-3,
.register-form-wrap .form-group {
    margin-bottom: 14px !important;
}
.register-form-wrap label {
    font-size: 13px;
    font-weight: 600;
    color: var(--mn-text);
    margin-bottom: 4px;
    display: block;
}
.register-form-wrap input[type="text"],
.register-form-wrap input[type="email"],
.register-form-wrap input[type="password"],
.register-form-wrap select,
.register-form-wrap .select2-selection {
    width: 100% !important;
    border: 1.5px solid #ece3d2 !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    background: #fdf9f2 !important;
    font-size: 14px !important;
    height: 46px !important;
    transition: all 0.2s ease;
}
.register-form-wrap input:focus,
.register-form-wrap select:focus {
    border-color: var(--mn-orange) !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(245,137,31,0.15) !important;
    outline: none !important;
}
.register-form-wrap .form-check {
    padding-left: 26px;
    margin-bottom: 6px;
}
.register-form-wrap .form-check-input {
    margin-left: -26px;
    margin-top: 4px;
    accent-color: var(--mn-orange);
}
.register-form-wrap button[type="submit"] {
    background: linear-gradient(135deg, var(--mn-orange) 0%, var(--mn-orange-dark) 100%) !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 14px 24px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    color: #fff !important;
    box-shadow: 0 10px 22px -8px rgba(245,137,31,0.6) !important;
    width: 100%;
    margin-top: 16px;
    text-transform: uppercase;
}
.register-form-wrap button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px -8px rgba(245,137,31,0.7) !important;
}

/* Select2 styling */
.select2-container--default .select2-selection--single {
    border: 1.5px solid #ece3d2 !important;
    border-radius: 12px !important;
    height: 46px !important;
    background: #fdf9f2 !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 44px !important;
    padding-left: 14px !important;
    color: var(--mn-text);
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 44px !important;
    right: 8px !important;
}

/* Form text help */
.register-form-wrap .form-text,
.register-form-wrap small.form-text {
    color: var(--mn-text-soft) !important;
    font-size: 12px !important;
    margin-top: 4px;
}

/* Register info text at top */
.register-form-wrap > .mb-2 {
    font-size: 13px;
    color: var(--mn-text-soft);
    margin-bottom: 18px !important;
}

/* Multi-method */
.main-login, .additional-logins {
    display: block !important;
    text-align: left;
    vertical-align: top;
    min-height: auto !important;
    width: 100% !important;
}
.vertical-line {
    width: 100%;
    height: 1px;
    background: #ece3d2;
    margin: 22px 0;
}
.login-content {
    min-height: auto !important;
    border: none !important;
}
br.clearfix { display: none; }

/* Responsive */
@media (max-width: 820px) {
    body { padding: 0; }
    main { padding: 12px; }
    .form-signin {
        grid-template-columns: 1fr;
        max-width: 480px;
        min-height: auto;
    }
    .brand-panel {
        padding: 36px 28px 90px;
        text-align: center;
        align-items: center;
    }
    .brand-title { font-size: 26px !important; }
    .brand-footer-row { margin: 0 auto; }
    .login-panel { padding: 36px 28px; }
    .logo-wrap img { width: 84px; height: 84px; }
    .mountains { height: 80px; }
    .mn-pattern { width: 50px; height: 50px; }
}
