/* ============================================================
   Tijarix - Login / Admin Login theme
   Shared by Login.aspx and AdminLogin.aspx
   Brand: deep navy (logo type) + orange (logo dots)
   ============================================================ */

:root {
    --navy-900: #0f1f3d;
    --navy-800: #16284d;
    --navy-700: #1e3a68;
    --navy-600: #27508c;
    --orange: #f2811d;
    --orange-600: #dd6d0c;
    --ink: #1f2937;
    --muted: #64748b;
    --line: rgba(15, 31, 61, 0.10);
    --line-strong: rgba(15, 31, 61, 0.18);
    --field: rgba(255, 255, 255, 0.72);
    --field-focus: #ffffff;
    --card: rgba(255, 255, 255, 0.80);
    --radius: 14px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #eef2f8 0%, #e7edf6 45%, #f5f7fb 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    line-height: 1.6;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Ambient background ---------- */
.login-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.login-bg .orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.5;
    animation: float 16s ease-in-out infinite;
}

.login-bg .orb-1 {
    width: 420px;
    height: 420px;
    top: -140px;
    left: -120px;
    background: radial-gradient(circle at 30% 30%, rgba(39, 80, 140, 0.55), rgba(39, 80, 140, 0));
}

.login-bg .orb-2 {
    width: 380px;
    height: 380px;
    bottom: -150px;
    right: -110px;
    background: radial-gradient(circle at 60% 40%, rgba(242, 129, 29, 0.45), rgba(242, 129, 29, 0));
    animation-delay: -6s;
}

.login-bg .orb-3 {
    width: 300px;
    height: 300px;
    top: 45%;
    right: 12%;
    background: radial-gradient(circle at 50% 50%, rgba(22, 40, 77, 0.28), rgba(22, 40, 77, 0));
    animation-delay: -11s;
}

@keyframes float {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(24px, -28px, 0) scale(1.08);
    }
}

/* ---------- Shell ---------- */
.login-container {
    width: 100%;
    max-width: 430px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: var(--card);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 24px;
    padding: 36px 34px 30px;
    box-shadow: 0 24px 60px -20px rgba(15, 31, 61, 0.28), 0 2px 8px rgba(15, 31, 61, 0.06);
    position: relative;
    animation: cardIn 0.5s var(--ease) both;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, var(--navy-700), var(--orange), var(--navy-700));
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Brand + headings ---------- */
.login-brand {
    text-align: center;
    margin-bottom: 22px;
}

.login-brand img {
    height: 35px;
    width: auto;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header h2 {
    color: var(--navy-900);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.login-header p {
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 400;
    margin: 0;
}

/* ---------- Fields ---------- */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.input-wrapper input {
    background: var(--field);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    height: 52px;
    padding: 0 16px;
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
    width: 100%;
    outline: none;
}

.input-wrapper input::placeholder {
    color: #9aa5b4;
    opacity: 1;
}

/* Leading icon variant */
.input-wrapper.with-icon input {
    padding-left: 46px;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #97a3b6;
    font-size: 15px;
    line-height: 1;
    pointer-events: none;
    transition: color 0.25s var(--ease);
    z-index: 2;
}

.input-wrapper input:focus {
    border-color: var(--navy-600);
    background: var(--field-focus);
    box-shadow: 0 0 0 4px rgba(39, 80, 140, 0.12);
}

.input-wrapper input:focus ~ .input-icon {
    color: var(--navy-600);
}

/* Animated bottom accent */
.focus-border {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--navy-600), var(--orange));
    transition: width 0.3s var(--ease), left 0.3s var(--ease);
    pointer-events: none;
}

.input-wrapper input:focus ~ .focus-border {
    width: 60%;
    left: 20%;
}

/* ---------- Password toggle ---------- */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    line-height: 0;
    transition: background 0.25s var(--ease);
    z-index: 3;
}

.password-toggle:hover {
    background: rgba(15, 31, 61, 0.06);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--navy-600);
    outline-offset: 1px;
}

.eye-icon {
    display: block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='1.6'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'/%3e%3c/svg%3e");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.eye-icon.show-password {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2327508c' stroke-width='1.6'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 11-4.243-4.243m4.242 4.242L9.88 9.88'/%3e%3c/svg%3e");
}

/* ---------- Inline validation ---------- */
.error-message {
    display: block;
    color: #c0261f;
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
    margin-left: 2px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transform: translateY(-4px);
    transition: all 0.25s var(--ease);
}

.error-message.show {
    max-height: 40px;
    opacity: 1;
    transform: translateY(0);
}

.form-group.error .input-wrapper input {
    border-color: #dc2626;
    background: rgba(220, 38, 38, 0.05);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.10);
    animation: shake 0.4s var(--ease);
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    20%, 60% {
        transform: translateX(-5px);
    }

    40%, 80% {
        transform: translateX(5px);
    }
}

/* ---------- Options row ---------- */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px;
    flex-wrap: wrap;
    gap: 12px;
}

.remember-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    margin: 0;
}

.remember-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-label {
    color: #4b5769;
    font-size: 13.5px;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--line-strong);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s var(--ease);
    flex-shrink: 0;
    background: #fff;
}

.remember-wrapper input[type="checkbox"]:checked ~ .checkbox-label .checkmark {
    background: var(--orange);
    border-color: var(--orange);
}

.remember-wrapper input[type="checkbox"]:focus-visible ~ .checkbox-label .checkmark {
    box-shadow: 0 0 0 3px rgba(242, 129, 29, 0.25);
}

.remember-wrapper input[type="checkbox"]:checked ~ .checkbox-label .checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
    animation: checkmarkPop 0.25s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkmarkPop {
    from {
        transform: rotate(45deg) scale(0);
    }

    to {
        transform: rotate(45deg) translate(-1px, -1px) scale(1);
    }
}

.forgot-password {
    color: var(--navy-600);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    transition: color 0.25s var(--ease);
    position: relative;
}

.forgot-password::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--orange);
    transition: width 0.25s var(--ease);
}

.forgot-password:hover {
    color: var(--orange-600);
    text-decoration: none;
}

.forgot-password:hover::after {
    width: 100%;
}

/* ---------- Buttons ---------- */
.btn {
    background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-600) 100%);
    border: none;
    border-radius: var(--radius);
    padding: 15px 24px;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px -8px rgba(22, 40, 77, 0.65);
}

/* Bootstrap sets .btn:hover { color: #212529 }, which outranks the plain
   .btn rule above - pin the text to white for every state. */
.btn,
.btn:hover,
.btn:focus,
.btn:active,
.btn:visited,
.btn:not(:disabled):not(.disabled):active {
    color: #fff;
}

.btn:hover:not(.is-loading) {
    transform: translateY(-2px);
    filter: brightness(1.08);
    box-shadow: 0 14px 28px -10px rgba(22, 40, 77, 0.7);
}

.btn:active {
    transform: translateY(0);
}

.btn:focus,
.btn:focus-visible {
    outline: none;
    box-shadow: 0 8px 20px -8px rgba(22, 40, 77, 0.65), 0 0 0 4px rgba(39, 80, 140, 0.22);
}

.btn.is-loading {
    pointer-events: none;
    opacity: 0.85;
    background-image: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-600) 100%), linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    background-size: 100% 100%, 40% 100%;
    background-repeat: no-repeat;
    background-position: 0 0, -40% 0;
    animation: shimmer 1.1s linear infinite;
}

@keyframes shimmer {
    to {
        background-position: 0 0, 140% 0;
    }
}

.login-btn {
    width: 100%;
    display: block;
    margin-bottom: 4px;
}

/* Secondary / text link under the form */
.login-footer {
    text-align: center;
    margin-top: 20px;
}

.back-link {
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.25s var(--ease);
}

.back-link:hover {
    color: var(--navy-700);
    text-decoration: none;
}

.back-link i {
    margin-right: 6px;
    font-size: 11px;
}

/* Helper copy on the company step */
.step-hint {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: rgba(39, 80, 140, 0.07);
    border: 1px solid rgba(39, 80, 140, 0.14);
    border-radius: 12px;
    padding: 12px 14px;
    color: #46536a;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 22px;
}

.step-hint i {
    color: var(--navy-600);
    margin-top: 3px;
}

.step-hint strong {
    color: var(--navy-800);
    font-weight: 600;
}

/* ---------- Alerts inside the card ---------- */
.login-card .alert {
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 13.5px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 9px;
    animation: cardIn 0.3s var(--ease) both;
}

.login-card .alert-danger {
    background: #fdecec;
    border-color: #f6c9c7;
    color: #a1201a;
}

.login-card .alert-warning {
    background: #fff6e8;
    border-color: #f7dcb2;
    color: #8a5300;
}

.login-card .alert-success {
    background: #eaf7ef;
    border-color: #bfe4cd;
    color: #1c6b3a;
}

/* ---------- Native select fallback (no JS / select2 not loaded) ---------- */
.custom-dropdown {
    width: 100%;
    height: 52px;
    background: var(--field);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 0 42px 0 16px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 400;
    font-family: inherit;
    outline: none;
    transition: all 0.25s var(--ease);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px 16px;
}

.custom-dropdown:hover,
.custom-dropdown:focus {
    border-color: var(--navy-600);
    background-color: var(--field-focus);
    box-shadow: 0 0 0 4px rgba(39, 80, 140, 0.12);
}

/* ============================================================
   Select2 (bootstrap4 theme) - matched to the login fields
   The dropdown is appended to <body>, so those rules are global.
   ============================================================ */
.login-card .select2-container {
    width: 100% !important;
}

.login-card .select2-container--bootstrap4 .select2-selection {
    background: var(--field);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

/* the theme locks the height with !important, so match it to the text inputs */
.login-card .select2-container--bootstrap4 .select2-selection--single {
    height: 52px !important;
}

.login-card .select2-container--bootstrap4 .select2-selection--single .select2-selection__rendered {
    line-height: 50px; /* 52px box - 2px borders */
    padding-left: 46px; /* clears the building icon */
    padding-right: 44px; /* clears the arrow */
    color: var(--ink);
    font-size: 15px;
}

.login-card .select2-container--bootstrap4 .select2-selection--single .select2-selection__placeholder {
    color: #9aa5b4;
    line-height: 50px;
}

/* Arrow: theme puts it at top:50% with no height, which drops it below the box */
.login-card .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow {
    top: 0;
    right: 14px;
    height: 100%;
    width: 12px;
}

.login-card .select2-container--bootstrap4 .select2-selection--single .select2-selection__arrow b {
    top: 50%;
    left: 50%;
    margin-top: -2px;
    margin-left: -5px;
    border-width: 5px 5px 0 5px;
    border-color: #64748b transparent transparent transparent;
    transition: transform 0.2s var(--ease);
}

.login-card .select2-container--bootstrap4.select2-container--focus .select2-selection,
.login-card .select2-container--bootstrap4.select2-container--open .select2-selection {
    border-color: var(--navy-600);
    background: var(--field-focus);
    box-shadow: 0 0 0 4px rgba(39, 80, 140, 0.12);
}

/* keep the field fully rounded when open - the theme squares the bottom
   corners and drops the bottom border to fuse it with the dropdown */
.login-card .select2-container--bootstrap4.select2-container--focus.select2-container--open .select2-selection {
    border-bottom: 1px solid var(--navy-600);
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

.login-card .select2-container--bootstrap4.select2-container--open .select2-selection__arrow b {
    transform: rotate(180deg);
    border-color: var(--navy-600) transparent transparent transparent;
}

/* icon sitting inside the select2 box */
.select-wrapper {
    position: relative;
}

.select-wrapper > .input-icon {
    z-index: 3;
}

/* keep room for the icon when select2 has not initialised yet */
.select-wrapper .custom-dropdown {
    padding-left: 46px;
}

/* Dropdown panel (rendered at <body> level) */
body.tjx-login .select2-container--bootstrap4 .select2-dropdown {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: 0 18px 40px -12px rgba(15, 31, 61, 0.32);
    overflow: hidden;
    margin-top: 6px;
}

body.tjx-login .select2-container--bootstrap4 .select2-dropdown--above {
    margin-top: 0;
    margin-bottom: 6px;
}

body.tjx-login .select2-container--bootstrap4 .select2-search--dropdown {
    padding: 10px;
    border-bottom: 1px solid var(--line);
}

body.tjx-login .select2-container--bootstrap4 .select2-search--dropdown .select2-search__field {
    height: 40px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 0 12px 0 34px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2394a3b8' stroke-width='2' viewBox='0 0 24 24'%3e%3ccircle cx='11' cy='11' r='7'/%3e%3cpath stroke-linecap='round' d='M20 20l-3.5-3.5'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 16px 16px;
}

body.tjx-login .select2-container--bootstrap4 .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--navy-600);
    box-shadow: 0 0 0 3px rgba(39, 80, 140, 0.12);
}

body.tjx-login .select2-container--bootstrap4 .select2-results > .select2-results__options {
    max-height: 240px;
    padding: 6px;
}

body.tjx-login .select2-container--bootstrap4 .select2-results__option {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14.5px;
    color: #34405a;
}

body.tjx-login .select2-container--bootstrap4 .select2-results__option--highlighted,
body.tjx-login .select2-container--bootstrap4 .select2-results__option--highlighted.select2-results__option[aria-selected=true] {
    background: rgba(39, 80, 140, 0.10);
    color: var(--navy-900);
}

body.tjx-login .select2-container--bootstrap4 .select2-results__option[aria-selected=true] {
    background: var(--navy-700);
    color: #fff;
    font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .login-card {
        padding: 28px 22px 24px;
        border-radius: 20px;
    }

    .login-header h2 {
        font-size: 1.4rem;
    }

    .form-options {
        flex-direction: row;
        align-items: center;
    }

    .login-bg .orb {
        filter: blur(60px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
