/* Glassmorphism Login Form - Complete & Self-Contained */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
    background: linear-gradient(135deg, #4f86eb 0%, #130a3b 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    line-height: 1.6;
}

.login-container {
    width: 100%;
    /* max-width: 420px; */
    max-width: 370px;
    /* perspective: 1000px; */
}

/* Form Group & Input Styles */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.input-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.input-wrapper input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px 16px 8px 16px;
    color: white;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    outline: none;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.input-wrapper input::placeholder {
    color: transparent;
}

.input-wrapper label {
    position: absolute;
    left: 16px;
    top: 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    transform-origin: left top;
}

.input-wrapper input:focus,
.input-wrapper input:valid {
    border-color: #06b6d4;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.2);
    color:white;
}

.input-wrapper input:focus + label,
.input-wrapper input:valid + label {
    /* transform: translateY(-8px) scale(0.85); */
    transform: translateY(-38px) scale(0.85);
    color: #06b6d4;
    font-weight: 500;
}

.focus-border {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #06b6d4, #6366f1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
    border-radius: 2px;
}

.input-wrapper input:focus ~ .focus-border {
    width: 100%;
}

.form-group.error .input-wrapper input {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    animation: shake 0.5s ease-in-out;
}

/* Button Styles */
.btn {
    background: linear-gradient(135deg, #6366f1 0%, #06b6d4 100%);
    border: none;
    border-radius: 12px;
    padding: 16px 24px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn::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;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.6);
    color:white;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(0);
}

/* Loading State */
.btn.loading {
    pointer-events: none;
}

.btn-text {
    transition: opacity 0.3s ease;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    opacity: 0;
    animation: spin 1s linear infinite;
    transition: opacity 0.3s ease;
}

.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .btn-loader {
    opacity: 1;
}

/* Animations */
@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.login-card {
    /* background: rgba(255, 255, 255, 0.1); */
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* border: 1px solid rgba(255, 255, 255, 0.2); */
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    /* padding: 40px; */
    padding: 20px 30px 20px 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #06b6d4, transparent);
    transition: left 0.5s ease;
}

.login-card:hover::before {
    left: 100%;
}

.login-card:hover {
    /* transform: translateY(-5px); */
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.login-header {
    text-align: center;
    /* margin-bottom: 32px; */
    margin-bottom: 15px;
}

.login-header h2 {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    /* margin-bottom: 8px; */
    margin-bottom: 0px;
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 0px;
}

/* Password Toggle Specific Styles */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    /* top: 50%; */
    top: 20%;
    /* transform: translateY(-50%); */
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.password-toggle:hover {
    color: rgba(255, 255, 255, 0.9);
}

.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='rgba(255,255,255,0.6)' stroke-width='1.5'%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;
    transition: background-image 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.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='rgba(255,255,255,0.6)' stroke-width='1.5'%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");
}

/* Login Button */
.login-btn {
    width: 100%;
    margin-bottom: 24px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .login-card {
        /* padding: 24px; */
        padding: 20px;
        /* margin: 10px; */
        margin: 0px;
        border-radius: 20px;
    }
    
    .login-header h2 {
        font-size: 1.75rem;
    }
    
    .password-wrapper input {
        padding-right: 44px;
    }    
}
/* === Accessibility: keyboard focus indicators === */
/* Restores visible focus rings for keyboard users without affecting mouse interaction. */
:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduced motion: respect user preference. Animations defined per form will tone down. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}