/*===== Body =====*/
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    background-color: var(--color-bg-base);
}

/*===== Theme Button (Floating) =====*/
.login-theme-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    transition: background var(--transition-fast),
        transform var(--transition-fast);
}

.login-theme-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

.login-theme-btn .icon-sun {
    display: none;
}

.login-theme-btn .icon-moon {
    display: block;
}

[data-theme="dark"] .login-theme-btn .icon-sun {
    display: block;
}

[data-theme="dark"] .login-theme-btn .icon-moon {
    display: none;
}

/*===== Wrapper =====*/
.login-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/*===== Brand Panel (Left) =====*/
.login-brand {
    position: relative;
    width: 45%;
    flex-shrink: 0;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 48px;
}

/*===== Animated Blobs =====*/
.brand-blob {
    position: absolute;
    border-radius: var(--radius-full);
    opacity: 0.18;
    filter: blur(60px);
    animation: blobFloat 8s ease-in-out infinite;
}

.brand-blob--1 {
    width: 320px;
    height: 320px;
    background: #ffffff;
    top: -80px;
    right: -80px;
    animation-delay: 0s;
}

.brand-blob--2 {
    width: 240px;
    height: 240px;
    background: #f7ae4f;
    bottom: -60px;
    left: -60px;
    animation-delay: 3s;
}

.brand-blob--3 {
    width: 180px;
    height: 180px;
    background: #ffffff;
    bottom: 30%;
    right: -40px;
    animation-delay: 5s;
    animation-duration: 10s;
}

@keyframes blobFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(20px, -20px) scale(1.05);
    }

    66% {
        transform: translate(-15px, 15px) scale(0.97);
    }
}

/*===== Dot Grid =====*/
.brand-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.25) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.5;
}

/*===== Brand Content =====*/
.brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #ffffff;
}

.brand-logo-wrap {
    width: 150px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-slow);
}

.brand-logo-wrap:hover {
    transform: translateY(-4px) scale(1.03);
}

.brand-logo {
    width: 120px;
    filter: brightness(0) invert(1);
}

.brand-title {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 12px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.brand-subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    margin-bottom: 36px;
}

/*===== Feature Pills =====*/
.brand-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 48px;
    text-align: right;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    padding: 10px 18px;
    font-size: 14px;
    color: #ffffff;
    backdrop-filter: blur(4px);
    transition: background var(--transition-fast),
        transform var(--transition-fast);
    animation: featureSlideIn 0.6s ease both;
}

.brand-feature:nth-child(1) {
    animation-delay: 0.1s;
}

.brand-feature:nth-child(2) {
    animation-delay: 0.2s;
}

.brand-feature:nth-child(3) {
    animation-delay: 0.3s;
}

.brand-feature:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-4px);
}

.brand-feature svg {
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

@keyframes featureSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

.brand-copy {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/*===== Form Panel (Right) =====*/
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: var(--color-bg-base);
    overflow-y: auto;
}

/*===== Login Card =====*/
.login-card {
    width: 100%;
    max-width: 420px;
    animation: cardFadeIn 0.5s ease both;
}

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

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

/*===== Card Header =====*/
.login-card-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-icon-wrap {
    width: 56px;
    height: 56px;
    background: var(--color-primary-muted);
    border: 1px solid rgba(120, 98, 84, 0.2);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--color-primary);
}

.login-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
}

/*===== Error Alert =====*/
.login-error {
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 20px;
    color: var(--color-danger);
    font-size: 13px;
    animation: errorShake 0.4s ease;
}

.login-error.visible {
    display: flex;
}

@keyframes errorShake {

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

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

/*===== Form =====*/
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/*===== Form Group =====*/
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.form-input-wrap {
    position: relative;
}

.form-icon {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.form-input {
    width: 100%;
    height: 48px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-bg-border);
    border-radius: var(--radius-lg);
    padding: 0 44px 0 44px;
    color: var(--color-text-primary);
    font-size: 14px;
    transition: border-color var(--transition-fast),
        box-shadow var(--transition-fast);
    outline: none;
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-muted);
}

.form-input:focus+.form-icon,
.form-group:focus-within .form-icon {
    color: var(--color-primary);
}

/*===== Input Error State =====*/
.form-group.has-error .form-input {
    border-color: var(--color-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-error-msg {
    font-size: 12px;
    color: var(--color-danger);
    min-height: 16px;
}

/*===== Eye Toggle =====*/
.form-eye-btn {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    display: flex;
    padding: 0;
    transition: color var(--transition-fast);
}

.form-eye-btn:hover {
    color: var(--color-primary);
}

.eye-hide {
    display: none;
}

.form-eye-btn.showing .eye-show {
    display: none;
}

.form-eye-btn.showing .eye-hide {
    display: block;
}

/*===== Submit Button =====*/
.login-submit-btn {
    width: 100%;
    height: 50px;
    background: var(--color-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    transition: background var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.login-submit-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.login-submit-btn:hover:not(:disabled) {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.login-submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.login-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/*===== Spinner =====*/
.btn-spinner {
    display: none;
    animation: spinRotate 0.8s linear infinite;
}

.btn-spinner.visible {
    display: flex;
}

@keyframes spinRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/*===== Demo Hint =====*/
.login-demo-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    padding: 12px 16px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-bg-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-size: 12px;
}

.login-demo-hint strong {
    color: var(--color-primary);
    font-family: monospace;
    font-size: 12px;
}


/*===== Fix: Ensure blobs are visible =====*/
.login-brand {
    isolation: isolate;
}

.brand-blob {
    z-index: 0;
    will-change: transform;
}

.brand-dots {
    z-index: 1;
    pointer-events: none;
}

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

/*===== Enhanced Blob Animation =====*/
.brand-blob--1 {
    animation: blobFloat1 9s ease-in-out infinite;
}

.brand-blob--2 {
    animation: blobFloat2 12s ease-in-out infinite;
}

.brand-blob--3 {
    animation: blobFloat3 7s ease-in-out infinite;
}

/*===== Canvas =====*/
.brand-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

@keyframes blobFloat1 {

    0%,
    100% {
        transform: translate(0px, 0px) scale(1);
    }

    25% {
        transform: translate(30px, -25px) scale(1.08);
    }

    50% {
        transform: translate(15px, 20px) scale(0.95);
    }

    75% {
        transform: translate(-20px, 10px) scale(1.04);
    }
}

@keyframes blobFloat2 {

    0%,
    100% {
        transform: translate(0px, 0px) scale(1);
    }

    30% {
        transform: translate(-25px, 20px) scale(1.06);
    }

    60% {
        transform: translate(20px, -15px) scale(0.96);
    }
}

@keyframes blobFloat3 {

    0%,
    100% {
        transform: translate(0px, 0px) scale(1);
    }

    40% {
        transform: translate(15px, 25px) scale(1.1);
    }

    70% {
        transform: translate(-10px, -20px) scale(0.92);
    }
}

/*===== Dot Grid Subtle Pulse =====*/
.brand-dots {
    animation: dotsPulse 6s ease-in-out infinite;
}

@keyframes dotsPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.8;
    }
}

/*===== Responsive — Tablet =====*/
@media (max-width: 900px) {
    .login-brand {
        width: 40%;
        padding: 32px 24px;
    }

    .brand-title {
        font-size: 24px;
    }

    .brand-subtitle {
        font-size: 13px;
    }
}

/*===== Responsive — Mobile =====*/
@media (max-width: 640px) {
    .login-wrapper {
        flex-direction: column;
    }

    .login-brand {
        width: 100%;
        min-height: 200px;
        padding: 32px 24px;
    }

    .brand-blob--1 {
        width: 180px;
        height: 180px;
    }

    .brand-blob--2 {
        width: 140px;
        height: 140px;
    }

    .brand-blob--3 {
        display: none;
    }

    .brand-features {
        display: none;
    }

    .brand-title {
        font-size: 22px;
        margin-bottom: 8px;
    }

    .brand-subtitle {
        font-size: 13px;
        margin-bottom: 0;
    }

    .brand-copy {
        display: none;
    }

    .login-form-panel {
        padding: 32px 20px;
    }

    .login-theme-btn {
        top: 12px;
        left: 12px;
    }
}

/*===== Large Screens =====*/
@media (min-width: 1600px) {
    .login-card {
        max-width: 460px;
    }

    .brand-title {
        font-size: 38px;
    }
}