/**
 * SEMI.LT - Clean Professional Login
 * Two-Field Design with Smart Validation
 * Version 6.0 - Simplified & Refined
 */

/* ============================================
   IMPORTS & VARIABLES
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Colors */
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --danger: #ef4444;
    --danger-light: #fca5a5;
    
    /* Neutrals */
    --white: #ffffff;
    --gray-100: #f4f4f5;
    --gray-200: #e4e4e7;
    --gray-300: #d4d4d8;
    --gray-400: #a1a1aa;
    --gray-600: #52525b;
    --gray-700: #3f3f46;
    --gray-900: #18181b;
    
    /* Spacing */
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Effects */
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Font */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes wiggle {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   BACKGROUND & CONTAINER
   ============================================ */

body.com-users-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    min-height: 100vh;
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

.com-users-login .container-component,
body.com-users-login .container-component {
    width: 100% !important;
    max-width: 100% !important;
    padding: var(--space-xl) !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    position: relative;
    overflow: hidden;
}

/* Animated Background Orbs */
.com-users-login .container-component::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
}

.com-users-login .container-component::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 15s ease-in-out infinite reverse;
    pointer-events: none;
}

/* ============================================
   LOGIN CARD
   ============================================ */

.custom-login-box {
    width: 100% !important;
    max-width: 460px !important;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.1),
        0 20px 60px -10px rgba(0, 0, 0, 0.3),
        0 10px 30px -10px rgba(0, 0, 0, 0.2);
    padding: var(--space-3xl) !important;
    margin: 0 auto !important;
    position: relative;
    z-index: 10;
    animation: fadeInUp 0.8s var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Top accent bar */
.custom-login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 0 0 4px 4px;
}

.custom-login-box .com-users-login {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

/* ============================================
   HEADER
   ============================================ */

.custom-login-box .page-header {
    margin-bottom: var(--space-2xl);
    padding: 0;
    border: none;
    text-align: center;
}

.custom-login-box .page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 var(--space-md) 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.custom-login-box .page-header::after {
    content: 'Prisijunkite prie savo paskyros';
    display: block;
    font-size: 16px;
    color: var(--gray-600);
    font-weight: 400;
    margin-top: var(--space-sm);
}

/* ============================================
   FORM FIELDS - CLEAN & PROFESSIONAL
   ============================================ */

.custom-login-box fieldset {
    border: none;
    padding: 0;
    margin: 0;
    width: 100% !important;
}

.custom-login-box .control-group,
.custom-login-box .com-users-login__input {
    margin-bottom: var(--space-xl);
    position: relative;
    width: 100% !important;
}

.custom-login-box .controls {
    position: relative;
    width: 100% !important;
}

/* Labels */
.custom-login-box .control-label,
.custom-login-box label:not(.form-check-label) {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-md);
    transition: color var(--transition);
}

.custom-login-box label .star {
    color: var(--danger);
}

/* Clean Input Fields - No color changes until submit */
.custom-login-box input[type="text"],
.custom-login-box input[type="password"],
.custom-login-box input[type="email"],
.custom-login-box .form-control {
    width: 100%;
    height: 56px;
    padding: 0 var(--space-lg);
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--gray-900);
    transition: all var(--transition);
    font-family: var(--font-body);
    font-weight: 500;
    outline: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.custom-login-box input:hover {
    border-color: var(--gray-300);
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.custom-login-box input:focus {
    border-color: var(--primary);
    box-shadow: 
        0 0 0 4px rgba(59, 130, 246, 0.12),
        0 4px 8px -2px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

/* Error State - Wiggle and red border (triggered on submit) */
.custom-login-box .has-danger input,
.custom-login-box input.invalid,
.custom-login-box input[aria-invalid="true"] {
    border-color: var(--danger);
    background: var(--white);
    box-shadow: 
        0 0 0 3px rgba(239, 68, 68, 0.1),
        0 1px 2px 0 rgba(239, 68, 68, 0.05);
    animation: wiggle 0.5s ease-in-out;
}

.custom-login-box .has-danger input:focus,
.custom-login-box input.invalid:focus {
    border-color: var(--danger);
    box-shadow: 
        0 0 0 4px rgba(239, 68, 68, 0.15),
        0 4px 8px -2px rgba(239, 68, 68, 0.1);
}

/* Error message styling */
.custom-login-box .form-control-feedback,
.custom-login-box .invalid-feedback,
.custom-login-box .alert-message {
    display: block;
    color: var(--danger);
    font-size: 13px;
    font-weight: 500;
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: rgba(239, 68, 68, 0.05);
    border-left: 3px solid var(--danger);
    border-radius: 4px;
    line-height: 1.5;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all var(--transition);
}

/* Show error with animation */
.custom-login-box .has-danger .form-control-feedback,
.custom-login-box .has-danger .invalid-feedback,
.custom-login-box .form-control-feedback:not(:empty),
.custom-login-box .invalid-feedback:not(:empty),
.custom-login-box .alert-message:not(:empty) {
    opacity: 1;
    max-height: 100px;
    animation: slideDown 0.3s ease-out;
}

/* Label turns red when error */
.custom-login-box .has-danger .control-label,
.custom-login-box .has-danger label:not(.form-check-label) {
    color: var(--danger);
}

/* ============================================
   PASSWORD FIELD
   ============================================ */

.custom-login-box .password-group {
    position: relative;
}

.custom-login-box .password-group input {
    padding-right: 56px !important;
}

.custom-login-box .input-password-toggle {
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    width: 56px !important;
    height: 56px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: var(--gray-400) !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
    transition: all var(--transition) !important;
    z-index: 10 !important;
}

.custom-login-box .input-password-toggle:hover {
    color: var(--primary) !important;
    background: rgba(59, 130, 246, 0.05) !important;
}

.custom-login-box .input-password-toggle .icon-eye,
.custom-login-box .input-password-toggle .icon-eye-slash {
    font-size: 20px;
}

.custom-login-box .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================
   HIDE REMEMBER ME CHECKBOX
   ============================================ */

.custom-login-box .login-remember,
.custom-login-box .com-users-login__remember {
    display: none !important;
}

/* ============================================
   SUBMIT BUTTON WITH ICON
   ============================================ */

.custom-login-box .com-users-login__submit {
    margin: var(--space-2xl) 0 var(--space-lg) 0;
}

.custom-login-box .btn-primary,
.custom-login-box button[type="submit"] {
    width: 100%;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: var(--radius-md);
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 12px -2px rgba(59, 130, 246, 0.4),
        0 2px 6px -1px rgba(59, 130, 246, 0.3),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

/* Login icon */
.custom-login-box .btn-primary::after,
.custom-login-box button[type="submit"]::after {
    content: '';
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4'%3E%3C/path%3E%3Cpolyline points='10 17 15 12 10 7'%3E%3C/polyline%3E%3Cline x1='15' y1='12' x2='3' y2='12'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
    transition: transform var(--transition);
    position: relative;
    z-index: 1;
}

.custom-login-box .btn-primary:hover::after,
.custom-login-box button[type="submit"]:hover::after {
    transform: translateX(4px);
}

/* Shimmer effect */
.custom-login-box .btn-primary::before,
.custom-login-box button[type="submit"]::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 500ms;
    z-index: 0;
}

.custom-login-box .btn-primary:hover::before,
.custom-login-box button[type="submit"]:hover::before {
    left: 100%;
}

.custom-login-box .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px -4px rgba(59, 130, 246, 0.5),
        0 4px 12px -2px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #60a5fa 0%, var(--primary) 100%);
}

.custom-login-box .btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.custom-login-box .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   FOOTER LINKS
   ============================================ */

.custom-login-box .com-users-login__options {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--gray-200);
}

.custom-login-box .com-users-login__options ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.custom-login-box .com-users-login__options li {
    margin: 0;
}

.custom-login-box .com-users-login__options a {
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: var(--transition);
}

.custom-login-box .com-users-login__options a:hover {
    color: var(--primary);
}

/* ============================================
   GLOBAL OVERRIDES
   ============================================ */

body.com-users-login .site-grid {
    padding: 0 !important;
}

body.com-users-login main {
    padding: 0 !important;
}

.com-users-login .container-breadcrumbs,
body.com-users-login .container-breadcrumbs {
    display: none !important;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (min-width: 769px) {
    .custom-login-box {
        min-width: 420px !important;
    }
}

@media (max-width: 768px) {
    .com-users-login .container-component,
    body.com-users-login .container-component {
        padding: var(--space-lg) !important;
    }
    
    .custom-login-box {
        max-width: 100% !important;
        padding: var(--space-xl) !important;
    }
}

@media (max-width: 640px) {
    .com-users-login .container-component,
    body.com-users-login .container-component {
        padding: var(--space-md) !important;
    }
    
    .custom-login-box {
        padding: var(--space-lg) var(--space-md) !important;
        border-radius: var(--radius-md) !important;
    }
    
    .custom-login-box .page-header h1 {
        font-size: 24px !important;
    }
    
    .custom-login-box .com-users-login__options ul {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
    
    .custom-login-box input,
    .custom-login-box .btn-primary,
    .custom-login-box .input-password-toggle {
        height: 52px !important;
    }
    
    .custom-login-box .input-password-toggle {
        width: 52px !important;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.custom-login-box *:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
