/* DSV Training System - Dark Animated Mobile Login */
:root {
    --dsv-dark: #0a0f1c;
    --dsv-darker: #050810;
    --dsv-blue: #1e3a8a;
    --dsv-light-blue: #3b82f6;
    --dsv-accent: #0ea5e9;
    --dsv-purple: #8b5cf6;
    --dsv-success: #10b981;
    --dsv-error: #ef4444;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --border-color: #1e293b;
    --input-bg: #0f172a;
    --card-bg: #0f1629;
    --glow-blue: rgba(59, 130, 246, 0.3);
    --glow-purple: rgba(139, 92, 246, 0.3);
}

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

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--dsv-darker);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Animated Background */
.login-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    background: linear-gradient(135deg, var(--dsv-darker) 0%, var(--dsv-dark) 50%, var(--dsv-blue) 100%);
}

.login-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, var(--glow-blue) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, var(--glow-purple) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(14, 165, 233, 0.1) 0%, transparent 50%);
    animation: backgroundPulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes backgroundPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}

/* Left Side - Animated Background */
.login-left {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--dsv-blue) 0%, var(--dsv-light-blue) 50%, var(--dsv-accent) 100%);
}

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(10, 15, 28, 0.8) 0%,
            rgba(30, 58, 138, 0.6) 50%,
            rgba(59, 130, 246, 0.4) 100%);
    backdrop-filter: blur(1px);
}

.background-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    max-width: 500px;
    animation: slideInLeft 1.2s ease-out;
}

/* Floating Animated Elements */
.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-icon {
    position: absolute;
    color: rgba(248, 250, 252, 0.2);
    font-size: 3rem;
    animation: floatComplex 12s ease-in-out infinite;
    animation-delay: var(--delay);
}

.floating-icon:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-duration: 15s;
}

.floating-icon:nth-child(2) {
    top: 60%;
    right: 15%;
    animation-duration: 18s;
}

.floating-icon:nth-child(3) {
    bottom: 20%;
    left: 20%;
    animation-duration: 12s;
}

.floating-icon:nth-child(4) {
    top: 30%;
    right: 10%;
    animation-duration: 20s;
}

@keyframes floatComplex {

    0%,
    100% {
        transform: translateY(0px) translateX(0px) rotate(0deg) scale(1);
        opacity: 0.2;
    }

    25% {
        transform: translateY(-30px) translateX(15px) rotate(90deg) scale(1.1);
        opacity: 0.4;
    }

    50% {
        transform: translateY(-20px) translateX(-10px) rotate(180deg) scale(0.9);
        opacity: 0.6;
    }

    75% {
        transform: translateY(-40px) translateX(20px) rotate(270deg) scale(1.2);
        opacity: 0.3;
    }
}

/* Animated Particles */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(248, 250, 252, 0.3);
    border-radius: 50%;
    animation: particleFloat 15s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) translateX(100px) rotate(360deg);
        opacity: 0;
    }
}

/* Welcome Content with Animations */
.welcome-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% {
        filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.3));
    }

    100% {
        filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.6));
    }
}

.welcome-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: slideInLeft 1.5s ease-out 0.3s both;
}

.welcome-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: slideInLeft 1.8s ease-out 0.6s both;
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 1.1rem;
    opacity: 0.9;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    animation: featureSlide 0.6s ease-out;
    animation-delay: calc(var(--index) * 0.2s);
    animation-fill-mode: both;
}

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

.feature-item .material-icons {
    color: var(--dsv-success);
    font-size: 1.5rem;
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {

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

    50% {
        transform: scale(1.1);
    }
}

@keyframes featureSlide {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

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

/* Right Side - Login Form with Animations */
.login-right {
    flex: 0 0 480px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: -20px 0 40px rgba(0, 0, 0, 0.5);
    border-left: 1px solid var(--border-color);
    animation: slideInRight 1.2s ease-out;
}

.login-right::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.login-form-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

/* Animated DSV Logo */
.login-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: headerFade 1.5s ease-out 0.5s both;
}

.dsv-logo {
    margin-bottom: 2rem;
    position: relative;
}

.logo-text {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--dsv-light-blue) 0%, var(--dsv-accent) 50%, var(--dsv-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
    animation: logoGlow 4s ease-in-out infinite;
    position: relative;
}

.logo-text::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--dsv-light-blue), var(--dsv-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(10px);
    opacity: 0.5;
    z-index: -1;
}

@keyframes logoGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
    }

    50% {
        filter: drop-shadow(0 0 25px rgba(139, 92, 246, 0.8));
    }
}

.logo-tagline {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: taglineFade 2s ease-out 1s both;
}

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

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

.login-title-section {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    position: relative;
}

.login-title-section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--dsv-light-blue), var(--dsv-purple));
    animation: borderExpand 2s ease-out 1.5s both;
}

@keyframes borderExpand {
    to {
        width: 100%;
        left: 0;
    }
}

.login-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    animation: titleSlide 1s ease-out 0.8s both;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    animation: subtitleSlide 1s ease-out 1s both;
}

@keyframes titleSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes subtitleSlide {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

/* Animated Form */
.login-form {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    animation: formSlide 0.8s ease-out;
    animation-delay: calc(var(--index) * 0.2s + 1.2s);
    animation-fill-mode: both;
}

@keyframes formSlide {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

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

.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 2;
    transition: all 0.3s ease;
}

.form-input {
    width: 100%;
    padding: 1.25rem 1rem 1.25rem 3rem;
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    position: relative;
}

.form-input::placeholder {
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: var(--dsv-light-blue);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 0 20px rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.form-input:focus~.input-icon {
    color: var(--dsv-light-blue);
    transform: translateY(-50%) scale(1.1);
}

.form-input:focus::placeholder {
    opacity: 0.7;
    transform: translateX(10px);
}

/* Animated Input Labels */
.input-label {
    position: absolute;
    left: 3rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--input-bg);
    padding: 0 0.5rem;
}

.form-input:focus+.input-label,
.form-input:not(:placeholder-shown)+.input-label {
    transform: translateY(-3rem) scale(0.875);
    color: var(--dsv-light-blue);
    background: var(--card-bg);
    font-weight: 500;
}

/* Animated Password Toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    color: var(--dsv-light-blue);
    background: rgba(59, 130, 246, 0.1);
    transform: translateY(-50%) scale(1.1);
}

/* Animated Login Button */
.login-button {
    width: 100%;
    padding: 1.25rem 2rem;
    background: linear-gradient(135deg, var(--dsv-blue) 0%, var(--dsv-light-blue) 50%, var(--dsv-accent) 100%);
    color: white;
    border: none;
    border-radius: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    min-height: 3.5rem;
    animation: buttonSlide 1s ease-out 2s both;
}

@keyframes buttonSlide {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.login-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(30, 58, 138, 0.4), 0 0 30px rgba(59, 130, 246, 0.3);
}

.login-button:active {
    transform: translateY(-1px);
}

.button-text {
    transition: all 0.3s ease;
}

.button-icon {
    transition: all 0.3s ease;
}

.login-button:hover .button-icon {
    transform: translateX(5px) rotate(15deg);
}

.button-loader {
    position: absolute;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-button.loading .button-text,
.login-button.loading .button-icon {
    opacity: 0;
}

.login-button.loading .button-loader {
    opacity: 1;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Animated Alert */
.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    animation: alertSlide 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid;
}

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

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

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

/* Animated Demo Accounts */
.demo-accounts {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    animation: demoSlide 1s ease-out 2.5s both;
}

@keyframes demoSlide {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.demo-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.demo-header .material-icons {
    animation: iconRotate 3s ease-in-out infinite;
}

@keyframes iconRotate {

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

    50% {
        transform: rotate(10deg);
    }
}

.demo-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.demo-account {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.demo-account::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.5s ease;
}

.demo-account:hover::before {
    left: 100%;
}

.demo-account:hover {
    border-color: var(--dsv-light-blue);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.2), 0 0 20px rgba(59, 130, 246, 0.1);
    transform: translateY(-3px) scale(1.02);
    background: rgba(30, 41, 59, 0.8);
}

.demo-role {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.demo-role .material-icons {
    font-size: 1.25rem;
    color: var(--dsv-light-blue);
    transition: all 0.3s ease;
}

.demo-account:hover .demo-role .material-icons {
    transform: scale(1.2) rotate(5deg);
    color: var(--dsv-accent);
}

.demo-credentials {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: "Courier New", monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.demo-account:hover .demo-credentials {
    color: var(--dsv-accent);
    background: rgba(59, 130, 246, 0.2);
}

/* Footer Animation */
.login-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    animation: footerFade 1s ease-out 3s both;
}

@keyframes footerFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Main Slide Animations */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

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

@keyframes headerFade {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

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

/* Mobile Responsive Design */
@media (max-width: 1024px) {
    .login-container {
        flex-direction: column;
    }

    .login-left {
        flex: 0 0 40vh;
        min-height: 40vh;
    }

    .login-right {
        flex: 1;
        min-height: 60vh;
    }

    .welcome-title {
        font-size: 2.5rem;
    }

    .welcome-features {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .feature-item {
        flex: 0 0 auto;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .login-left {
        flex: 0 0 35vh;
        min-height: 35vh;
    }

    .login-right {
        flex: 1;
        min-height: 65vh;
    }

    .login-form-container {
        padding: 1.5rem;
        max-width: 100%;
    }

    .welcome-title {
        font-size: 2rem;
    }

    .welcome-subtitle {
        font-size: 1.25rem;
    }

    .logo-text {
        font-size: 2.5rem;
    }

    .form-input {
        padding: 1.25rem 1rem 1.25rem 3rem;
        font-size: 1rem;
    }

    .login-button {
        padding: 1.25rem 2rem;
        font-size: 1rem;
        min-height: 3.5rem;
    }

    .demo-accounts {
        padding: 1.25rem;
    }

    .demo-account {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .login-form-container {
        padding: 1rem;
    }

    .welcome-title {
        font-size: 1.75rem;
    }

    .logo-text {
        font-size: 2rem;
    }

    .form-input {
        padding: 1.25rem 1rem 1.25rem 2.75rem;
    }

    .input-icon {
        left: 0.75rem;
    }

    .input-label {
        left: 2.75rem;
    }

    .demo-account {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 1.25rem;
    }

    .demo-credentials {
        align-self: flex-end;
    }

    .feature-item {
        min-width: 150px;
        font-size: 0.9rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .login-button {
        min-height: 3.5rem;
    }

    .form-input {
        min-height: 3.5rem;
    }

    .demo-account {
        min-height: 3.5rem;
    }

    .password-toggle {
        min-width: 3rem;
        min-height: 3rem;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}