/**
 * AID 2.0 - Clean Login Page
 * Split screen design with form on left, image on right
 * No animations, focus on UX
 */

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

html, body {
    overflow: hidden;
    height: 100vh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Split Screen Layout */
.login-wrapper {
    display: flex;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* Left Side - Form */
.login-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    background: linear-gradient(to right, #ffffff 0%, #fafafa 70%, #f5f5f5 100%);
    overflow-y: auto;
    height: 100vh;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.login-left::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.login-content {
    width: 100%;
    max-width: 420px;
}

/* Brand */
.brand {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 1rem;
    position: relative;
    z-index: 100;
}

.brand-logo a {
    display: inline-block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.brand-logo a:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.nepad-logo {
    height: 50px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

/* Translate Container - Hidden for automatic translation */
.translate-container {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

.translate-container:hover {
    box-shadow: 0 4px 12px rgba(93, 12, 52, 0.3);
    transform: translateY(-1px);
}

.globe-icon {
    display: flex;
    align-items: center;
    color: #1f1f1f;
    flex-shrink: 0;
}

.globe-icon svg {
    width: 20px;
    height: 20px;
}

/* Google Translate Widget - Custom Styling */
.translate-widget {
    font-size: 13px;
    line-height: 1;
}

.translate-widget .goog-te-gadget {
    font-family: inherit !important;
    line-height: 1 !important;
}

/* Hide Google logo/branding */
.translate-widget .goog-te-gadget-simple img,
.translate-widget .goog-te-gadget img,
#google_translate_element img,
.goog-te-gadget-icon {
    display: none !important;
}

.translate-widget .goog-te-gadget-simple {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    font-size: 13px !important;
    color: #000000 !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
}

.translate-widget .goog-te-gadget-simple .goog-te-menu-value {
    color: #000000 !important;
    vertical-align: middle !important;
}

.translate-widget .goog-te-gadget-simple .goog-te-menu-value span {
    color: #000000 !important;
}

/* Hide "Select Language" text - Multiple selectors for reliability */
.translate-widget .goog-te-gadget-simple .goog-te-menu-value span:first-child,
.translate-widget .goog-te-gadget-simple .goog-te-menu-value > span:nth-child(1),
#google_translate_element .goog-te-gadget-simple .goog-te-menu-value span:first-child,
.goog-te-gadget .goog-te-combo + span,
.translate-container .goog-te-gadget-simple span:first-child {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    overflow: hidden !important;
}

/* Show only the language name (last span) */
.translate-widget .goog-te-gadget-simple .goog-te-menu-value span:last-child,
.translate-widget .goog-te-gadget-simple .goog-te-menu-value > span:nth-child(3) {
    border-left: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Hide Google Translate banner and notification */
.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame,
body > .skiptranslate,
#goog-gt-tt,
.goog-te-balloon-frame {
    display: none !important;
    visibility: hidden !important;
}

body {
    top: 0px !important;
}

/* Language Detection Notification */
.language-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #5D0C34 0%, #8B1A4A 100%);
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    opacity: 1;
    transition: opacity 0.3s ease;
    font-size: 14px;
    max-width: 320px;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-content svg {
    flex-shrink: 0;
}

.notification-content strong {
    font-weight: 700;
}

.goog-te-menu-frame {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-radius: 8px !important;
}

/* Welcome Text */
.welcome-text {
    margin-bottom: 2.5rem;
}

.welcome-title {
    font-size: 32px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}

.welcome-subtitle {
    font-size: 15px;
    color: #666;
    line-height: 1.5;
}

/* Alerts */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 14px;
    line-height: 1.4;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Form */
.login-form {
    margin-bottom: 1.5rem;
}

.input-group {
    position: relative;
    margin-bottom: 1rem;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    display: flex;
    align-items: center;
    pointer-events: none;
}

.input-field {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #ffffff;
    transition: border-color 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: #5D0C34;
    box-shadow: 0 0 0 3px rgba(93, 12, 52, 0.1);
}

.input-field::placeholder {
    color: #9ca3af;
}

/* Buttons */
.btn-submit {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #5D0C34 0%, #8B1A4A 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(93, 12, 52, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(93, 12, 52, 0.4);
}

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

/* Divider */
.divider {
    text-align: center;
    margin: 1.5rem 0;
    color: #9ca3af;
    font-size: 14px;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: #e5e7eb;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

/* Google Button */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: #ffffff;
    color: #1a1a1a;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    font-family: inherit;
    transition: border-color 0.2s, background 0.2s;
}

.btn-google:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Footer */
.login-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 14px;
    color: #666;
}

.nepad-attribution {
    margin-top: 1rem;
    text-align: center;
    font-size: 12px;
    color: #9ca3af;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.link {
    color: #5D0C34;
    text-decoration: none;
    font-weight: 600;
}

.link:hover {
    color: #8B1A4A;
    text-decoration: underline;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #5D0C34;
    outline-offset: 2px;
}

/* Social Proof Section */
.social-proof {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.social-proof:hover {
    border-color: #5D0C34;
    box-shadow: 0 4px 12px rgba(93, 12, 52, 0.2);
}

.social-proof-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.user-avatars {
    display: flex;
    align-items: center;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid #ffffff;
    overflow: hidden;
    position: relative;
}

.avatar:not(:first-child) {
    margin-left: -12px;
}

.avatar svg {
    width: 100%;
    height: 100%;
}

.social-proof-text {
    flex: 1;
}

.social-proof-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.125rem;
}

.social-proof-subtitle {
    font-size: 13px;
    color: #9ca3af;
}

.social-proof-arrow {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    border-radius: 50%;
    color: #1a1a1a;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.social-proof-arrow:hover {
    background: linear-gradient(135deg, #5D0C34 0%, #8B1A4A 100%);
    border-color: #5D0C34;
    color: #ffffff;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(93, 12, 52, 0.3);
}

/* Right Side - Image Slider */
.login-right {
    flex: 1;
    background: #f8f9fa;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    margin: 0;
    position: relative;
    overflow: hidden;
    height: 100vh;
    box-shadow: inset 4px 0 12px rgba(0, 0, 0, 0.08);
}

/* Slider Container */
.slider-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Slider Track */
.slider-track {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Individual Slide */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    max-height: 100vh;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Slide Caption */
.slide-caption {
    position: absolute;
    bottom: 3rem;
    left: 3rem;
    right: 3rem;
    color: white;
    z-index: 2;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    padding: 2rem;
    border-radius: 8px;
}

.slide-caption h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.slide-caption p {
    font-size: 1rem;
    opacity: 0.95;
    line-height: 1.7;
    font-style: italic;
    max-width: 800px;
}

/* Slider Dots */
.slider-dots {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 3;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid white;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.dot.active {
    background: white;
    width: 32px;
    border-radius: 6px;
}

/* Left Fade Overlay - Seamless blend with left background */
.slider-fade-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 100%;
    background: linear-gradient(to right, 
        rgba(245, 245, 245, 1) 0%,
        rgba(250, 250, 250, 0.95) 10%,
        rgba(255, 255, 255, 0.85) 25%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.3) 75%,
        rgba(255, 255, 255, 0) 100%
    );
    z-index: 2;
    pointer-events: none;
}

/* Skeleton Loader */
.slider-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    z-index: 10;
    transition: opacity 0.3s ease;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.hero-content {
    max-width: 600px;
    color: #ffffff;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 16px;
    line-height: 1.5;
    opacity: 0.9;
    margin-bottom: 2.5rem;
}

/* Infographic */
.infographic {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-icon {
    margin-bottom: 0.75rem;
    opacity: 0.9;
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 13px;
    opacity: 0.85;
}

/* Features */
.features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 15px;
    opacity: 0.95;
}

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

/* Tablet landscape — narrow the right panel */
@media (max-width: 1024px) {
    .login-right {
        flex: 0.8;
    }
    
    .slide-caption h3 {
        font-size: 1.5rem;
    }
    
    .slide-caption p {
        font-size: 0.875rem;
    }
    
    .slide-caption {
        bottom: 2rem;
        left: 2rem;
        right: 2rem;
        padding: 1.5rem;
    }
}

/* Tablet portrait and below — HIDE image slider, form goes full width */
@media (max-width: 768px) {
    html, body {
        overflow: auto;
        height: auto;
        min-height: 100vh;
    }
    
    .login-wrapper {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        max-height: none;
    }
    
    .login-left {
        flex: none;
        width: 100%;
        height: auto;
        min-height: 100vh;
        padding: 2rem 1.5rem;
        align-items: flex-start;
        justify-content: flex-start;
        padding-top: 3rem;
        background: #ffffff;
    }
    
    .login-content {
        max-width: 480px;
        margin: 0 auto;
        width: 100%;
    }
    
    /* Hide the entire right side (image slider) on mobile */
    .login-right {
        display: none !important;
    }
    
    .welcome-text {
        margin-bottom: 2rem;
    }
    
    .welcome-title {
        font-size: 26px;
    }
    
    .welcome-subtitle {
        font-size: 14px;
    }
    
    .brand {
        margin-bottom: 1.5rem;
    }
    
    .nepad-logo {
        height: 44px;
    }
    
    /* Prevent iOS zoom on input focus */
    .input-field {
        font-size: 16px;
    }
    
    .social-proof {
        padding: 1rem 1.25rem;
    }
    
    .social-proof-title {
        font-size: 14px;
    }
    
    .social-proof-subtitle {
        font-size: 12px;
    }
    
    .avatar {
        width: 40px;
        height: 40px;
    }
    
    .social-proof-arrow {
        width: 40px;
        height: 40px;
    }
    
    .nepad-attribution {
        margin-top: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .language-notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .login-left {
        padding: 1.5rem 1rem;
        padding-top: 2rem;
    }
    
    .welcome-title {
        font-size: 22px;
    }
    
    .welcome-subtitle {
        font-size: 13px;
    }
    
    .brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .nepad-logo {
        height: 40px;
    }
    
    .btn-submit {
        padding: 1rem 1.5rem;
        font-size: 16px;
    }
    
    .btn-google {
        padding: 0.875rem 1rem;
        font-size: 14px;
    }
    
    .alert {
        padding: 0.75rem;
        font-size: 13px;
    }
    
    .login-footer {
        font-size: 13px;
    }
    
    .social-proof {
        padding: 0.875rem 1rem;
        gap: 0.75rem;
    }
    
    .avatar {
        width: 36px;
        height: 36px;
    }
    
    .social-proof-arrow {
        width: 36px;
        height: 36px;
    }
    
    .divider {
        margin: 1.25rem 0;
    }
    
    .email-service-icons {
        gap: 0.5rem;
    }
}
