:root {
    --primary-blue: #0d6efd;
    --primary-dark: #0a58ca;
    --gradient-start: #0d6efd;
    --gradient-end: #0a58ca;
    --light-blue: #e7f1ff;
    --accent-blue: #3d8bfd;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0a58ca 0%, #0d6efd 50%, #0d6efd 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: -25%;
    left: -25%;
    width: 150vw;
    height: 150vh;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(13, 110, 253, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(13, 110, 253, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(10, 88, 202, 0.05) 0%, transparent 50%);
    animation: drift 20s ease-in-out infinite;
}

@keyframes drift {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -30px) rotate(2deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(-2deg);
    }
}

/* Subtle grain texture */
body::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300"><filter id="n"><feTurbulence baseFrequency="0.9" numOctaves="3"/></filter><rect width="300" height="300" filter="url(%23n)" opacity="0.05"/></svg>');
    pointer-events: none;
}

.login-container,
.forgot-container,
.reset-container,
.bind-container
{
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
}

.login-card,
.forgot-card,
.reset-card,
.bind-card
{
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(13, 110, 253, 0.1),
        inset 0 2px 4px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: cardEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

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

.login-header,
.forgot-header,
.reset-header,
.bind-header
{
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    padding: 50px 40px 45px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-header::before,
.forgot-header::before,
.reset-header::before,
.bind-header::before
{
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><path d="M0 0L50 50M50 0L100 50M0 50L50 100M50 50L100 100" stroke="white" stroke-width="0.5" opacity="0.03"/></svg>');
    animation: patternMove 30s linear infinite;
}

@keyframes patternMove {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(100px, 100px);
    }
}

.login-header .logo,
.forgot-header .logo,
.reset-header .logo,
.bind-header .logo
{
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
    background: white;
    width: 260px;
    height: 260px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 50%;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.login-header .logo img,
.forgot-header .logo img,
.reset-header .logo img,
.bind-header .logo img
{
    max-width: 220px;
    max-height: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
    animation: logoGlow 0.8s ease-out;
}

@keyframes logoGlow {
    from {
        opacity: 0;
        transform: translateY(-15px) scale(0.9);
    }

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

.login-header h1,
.forgot-header h1,
.reset-header h1,
.bind-header h1
{
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.login-header p,
.forgot-header p,
.reset-header p,
.bind-header p
{
    font-size: 0.875rem;
    opacity: 0.92;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin: 0;
    position: relative;
    z-index: 1;
}

.login-body,
.forgot-body,
.reset-body,
.bind-body
{
    padding: 45px 40px 40px;
    background: white;
}

.info-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid var(--primary-blue);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 26px;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.08);
}

.info-box i {
    color: var(--primary-blue);
    margin-right: 10px;
    font-size: 1.05rem;
}

.info-box p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--primary-dark);
    line-height: 1.65;
    font-weight: 500;
}

.form-floating {
    margin-bottom: 22px;
    position: relative;
}

.form-select {
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #FAFAFA;
}

.form-select:focus {
    border-color: var(--primary-blue);
    background: white;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.08), 0 2px 8px rgba(13, 110, 253, 0.1);
    outline: none;
}

.company-select {
    padding-left: 52px;
}

.form-control {
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #FAFAFA;
}

.form-control:focus {
    border-color: var(--primary-blue);
    background: white;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.08), 0 2px 8px rgba(13, 110, 253, 0.1);
    transform: translateY(-1px);
}

.form-floating>label {
    padding: 1rem 20px;
    padding-left: 52px;
    color: #6B7280;
    font-weight: 500;
    font-size: 0.9rem;
}

.input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 1.05rem;
    z-index: 10;
    pointer-events: none;
    transition: color 0.3s ease;
}

.form-control:focus~.input-icon,
.form-floating:focus-within .input-icon {
    color: var(--primary-blue);
}

.form-floating .form-control {
    padding-left: 52px;
}

.password-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    z-index: 10;
    padding: 6px;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.password-toggle:hover {
    color: var(--primary-blue);
    background: rgba(13, 110, 253, 0.05);
}

.form-check {
    margin-bottom: 28px;
    padding-left: 1.75rem;
}

.form-check-input {
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid #D1D5DB;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

.form-check-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
}

.btn-login,
.btn-reset,
.btn-bind
{
    width: 100%;
    padding: 16px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-reset {
    margin-top: 32px;
    margin-bottom: 16px;
}

.btn-login::before,
.btn-reset::before,
.btn-bind::before
{
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-login:hover,
.btn-reset:hover,
.btn-bind:hover
{
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(13, 110, 253, 0.5);
}

.btn-login:hover::before,
.btn-reset:hover::before,
.btn-bind:hover::before
{
    opacity: 1;
}

.btn-login:active,
.btn-reset:active,
.btn-bind:active
{
    transform: translateY(-1px);
}

.btn-back {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    background: white;
    color: #4B5563;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    transform: translateY(-1px);
}

.success-state {
    text-align: center;
    padding: 35px 0;
}

.success-state .icon {
    font-size: 4.5rem;
    color: #10B981;
    margin-bottom: 22px;
    animation: successPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-state h3 {
    color: #1F2937;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 14px;
    font-family: 'Playfair Display', serif;
}

.success-state p {
    color: #6B7280;
    font-size: 0.95rem;
    margin-bottom: 28px;
    line-height: 1.7;
    font-weight: 500;
}

.divider {
    text-align: center;
    margin: 28px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #E5E7EB 20%, #E5E7EB 80%, transparent);
}

.divider span {
    background: white;
    padding: 0 18px;
    color: #9CA3AF;
    font-size: 0.85rem;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.link-text {
    text-align: center;
    margin-top: 24px;
}

.link-text a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.link-text a:hover {
    color: var(--primary-dark);
    gap: 8px;
}

.link-text a i {
    transition: transform 0.2s ease;
}

.link-text a:hover i {
    transform: translateX(2px);
}

.login-footer,
.forgot-footer,
.reset-footer,
.bind-footer
{
    text-align: center;
    margin-top: 35px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
    position: relative;
    z-index: 1;
}

.login-footer a,
.forgot-footer a,
.reset-footer a,
.bind-footer a
{
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.login-footer a:hover,
.forgot-footer a:hover,
.reset-footer a:hover,
.bind-footer a:hover
{
    color: white;
    text-decoration: underline;
}

.alert-custom {
    border-radius: 12px;
    border: none;
    padding: 14px 18px;
    margin-bottom: 22px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: alertSlide 0.3s ease-out;
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* Captcha Styles */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.captcha-display {
    flex: 1;
    height: 52px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 8px;
    color: #1a1a1a;
    text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.captcha-display::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px);
    pointer-events: none;
}

.captcha-display canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.captcha-refresh {
    width: 52px;
    height: 52px;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    background: white;
    color: #6B7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.captcha-refresh:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: rgba(13, 110, 253, 0.05);
}

.captcha-input {
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #FAFAFA;
}

.captcha-input:focus {
    border-color: var(--primary-blue);
    background: white;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.08), 0 2px 8px rgba(13, 110, 253, 0.1);
    outline: none;
}

.captcha-error {
    color: var(--primary-blue);
    font-size: 0.85rem;
    margin-top: 6px;
    display: none;
}

.captcha-error.show {
    display: block;
}

@media (max-width: 576px) {
    .login-header,
    .forgot-header,
    .reset-header,
    .bind-header
    {
        padding: 40px 28px 35px;
    }

    .login-body,
    .forgot-body,
    .reset-body,
    .bind-body
    {
        padding: 35px 28px 32px;
    }

    .login-header h1,
    .forgot-header h1,
    .reset-header h1,
    .bind-header h1
    {
        font-size: 1.5rem;
    }

    .login-header .logo img,
    .forgot-header .logo img,
    .reset-header .logo img,
    .bind-header .logo img
    {
        max-width: 180px;
        max-height: 180px;
    }

    .captcha-container {
        flex-direction: column;
    }

    .captcha-display {
        width: 100%;
    }

    .captcha-refresh {
        width: 100%;
    }
}

/* === QX 0812 UI skin: login, light mode only === */
:root {
    --primary-blue: #087d98;
    --primary-dark: #064a5c;
    --gradient-start: #ecfbff;
    --gradient-end: #d7f2f7;
    --light-blue: #dff7fb;
    --accent-blue: #33dce8;
    --qx-ink: #0e2b3c;
    --qx-muted: #5d7888;
    --qx-line: rgba(8, 125, 152, 0.24);
}

body {
    min-height: 100vh;
    color: var(--qx-ink);
    background:
        radial-gradient(circle at 20% 14%, rgba(51, 220, 232, 0.22), transparent 24%),
        radial-gradient(circle at 86% 8%, rgba(247, 193, 109, 0.2), transparent 22%),
        linear-gradient(118deg, rgba(8, 125, 152, 0.14), transparent 28% 62%, rgba(51, 220, 232, 0.12)),
        repeating-linear-gradient(0deg, rgba(8, 125, 152, 0.058) 0 1px, transparent 1px 54px),
        repeating-linear-gradient(90deg, rgba(8, 125, 152, 0.05) 0 1px, transparent 1px 54px),
        linear-gradient(135deg, #f8feff 0%, #e3f6fa 52%, #f7fdff 100%) !important;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(118deg, transparent 0 15%, rgba(8, 125, 152, 0.08) 15% 17%, transparent 17% 100%),
        linear-gradient(64deg, transparent 0 68%, rgba(247, 193, 109, 0.12) 68% 69%, transparent 69% 100%);
    opacity: 0.88;
}

.login-container,
.forgot-container,
.reset-container,
.bind-container {
    position: relative;
    z-index: 1;
    align-items: center;
    padding: 40px 20px;
}

.login-card,
.forgot-card,
.reset-card,
.bind-card {
    overflow: hidden;
    border: 1px solid var(--qx-line);
    border-radius: 12px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(235, 251, 255, 0.9)),
        repeating-linear-gradient(0deg, rgba(8, 125, 152, 0.045) 0 1px, transparent 1px 26px),
        repeating-linear-gradient(90deg, rgba(8, 125, 152, 0.04) 0 1px, transparent 1px 26px);
    box-shadow: 0 24px 58px rgba(13, 73, 92, 0.18);
    backdrop-filter: blur(18px);
}

.login-header,
.forgot-header,
.reset-header,
.bind-header {
    padding: 42px 44px 30px;
    color: var(--qx-ink);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(215, 247, 253, 0.86)),
        radial-gradient(circle at 18% 16%, rgba(51, 220, 232, 0.22), transparent 26%);
    border-bottom: 1px solid rgba(8, 125, 152, 0.18);
}

.login-header::before,
.forgot-header::before,
.reset-header::before,
.bind-header::before {
    background:
        linear-gradient(90deg, transparent, rgba(51, 220, 232, 0.22), transparent),
        repeating-linear-gradient(90deg, rgba(8, 125, 152, 0.08) 0 1px, transparent 1px 32px);
    opacity: 0.75;
}

.login-header .logo,
.forgot-header .logo,
.reset-header .logo,
.bind-header .logo {
    margin-bottom: 18px;
}

.login-header .logo img,
.forgot-header .logo img,
.reset-header .logo img,
.bind-header .logo img {
    max-width: 148px;
    max-height: 148px;
    border-radius: 16px;
}

.login-header h1,
.forgot-header h1,
.reset-header h1,
.bind-header h1 {
    color: var(--qx-ink);
    font-size: 1.82rem;
    font-weight: 900;
    letter-spacing: 0;
    text-shadow: none;
}

.login-header p,
.forgot-header p,
.reset-header p,
.bind-header p {
    color: var(--qx-muted);
    font-weight: 700;
}

.login-body,
.forgot-body,
.reset-body,
.bind-body {
    padding: 36px 44px 38px;
    background: rgba(255, 255, 255, 0.72);
}

.form-label {
    color: #24485a;
    font-weight: 800;
}

.form-control,
.form-select,
.captcha-input {
    border: 1px solid rgba(8, 125, 152, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--qx-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.form-control:focus,
.form-select:focus,
.captcha-input:focus {
    border-color: rgba(8, 125, 152, 0.62);
    box-shadow: 0 0 0 4px rgba(51, 220, 232, 0.16), 0 10px 20px rgba(8, 125, 152, 0.08);
}

.input-icon {
    color: var(--primary-blue);
}

.password-toggle,
.captcha-refresh {
    color: var(--primary-blue);
}

.captcha-display {
    border: 1px solid rgba(8, 125, 152, 0.26);
    border-radius: 8px;
    background: linear-gradient(135deg, #f6fdff, #e7f8fb);
    color: var(--qx-ink);
}

.btn-login,
.btn-reset,
.btn-bind {
    border: 1px solid rgba(8, 125, 152, 0.38);
    border-radius: 8px;
    background: linear-gradient(135deg, #087d98 0%, #33dce8 100%);
    box-shadow: 0 14px 28px rgba(8, 125, 152, 0.22);
    color: #ffffff;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.btn-login:hover,
.btn-reset:hover,
.btn-bind:hover {
    border-color: rgba(6, 74, 92, 0.5);
    background: linear-gradient(135deg, #064a5c 0%, #087d98 100%);
    box-shadow: 0 18px 34px rgba(8, 125, 152, 0.28);
}

.btn-back {
    border-radius: 8px;
    color: var(--primary-blue);
}

.login-footer,
.forgot-footer,
.reset-footer,
.bind-footer {
    color: var(--qx-muted);
}

.login-footer a,
.forgot-footer a,
.reset-footer a,
.bind-footer a {
    color: var(--primary-blue);
    font-weight: 800;
}

@media (max-width: 576px) {
    .login-container,
    .forgot-container,
    .reset-container,
    .bind-container {
        padding: 18px 12px;
    }

    .login-header,
    .forgot-header,
    .reset-header,
    .bind-header {
        padding: 32px 26px 24px;
    }

    .login-body,
    .forgot-body,
    .reset-body,
    .bind-body {
        padding: 28px 24px 30px;
    }

    .login-header .logo img,
    .forgot-header .logo img,
    .reset-header .logo img,
    .bind-header .logo img {
        max-width: 120px;
        max-height: 120px;
    }
}
