@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
    /* Modern Green Color Palette */
    --primary-green: #3a7d44;
    --primary-green-hover: #5eae70;
    --primary-green-light: #dcfce7;
    --secondary-green: #15803d;
    --accent-green: #bbf7d0;
    --success-green: #10b981;
    
    /* Neutral Colors */
    --background-gray: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --white: #ffffff;
    
    /* Error Colors */
    --error-red: #ef4444;
    --error-bg: #fef2f2;
    --error-border: #fca5a5;
}

/* For modern browsers */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #e0f2e9; /* light green track */
}

::-webkit-scrollbar-thumb {
    background-color: #28a745; /* solid green thumb */
    border-radius: 6px;
    border: 3px solid #e0f2e9;
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #28a745 #e0f2e9;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f7fa;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Mobile-first approach */
.login-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--white);
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.signup-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--white);
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

.image-section {
    background: linear-gradient(135deg, #3a7d44 0%, #5eae70 100%);
    padding: 40px 20px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    text-align: center;
    position: relative;
    color: var(--white);
    min-height: 250px;
    flex-shrink: 0;
}

.image-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.image-content {
    position: relative;
    z-index: 2;
}

.logo {
    margin-bottom: 10px;
    margin-top: 0;
    font-size: 24px;
    font-weight: 800;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon {
    margin-right: 8px;
    font-size: 28px;
}

.image-section h2 {
    font-size: 24px;
    margin-bottom: 8px;
    margin-top: 0;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.image-section p {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 0;
    margin-top: 0;
    opacity: 0.95;
}

/* ======================
   BUBBLE ANIMATION STYLES
   ====================== */

/* Container for all bubbles */
.bubbles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none; /* Allows clicks to pass through */
}

/* Individual bubble styling */
.bubbles span {
    position: absolute;
    bottom: -50px; /* Start below viewport */
    border-radius: 50%;
    animation: bubble-float var(--duration, 10s) linear infinite;
    
    /* Positioning and timing */
    left: calc(100% * var(--i) / 25); /* Spread across width */
    animation-delay: calc(-1s * var(--i)); /* Stagger animation start */
    
    /* Bubble appearance - easily customizable */
    width: var(--size, 20px);
    height: var(--size, 20px);
    background: var(--color, rgba(255, 255, 255, 0.2));
    
    /* Optional: Add subtle glow effect */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Bubble floating animation */
@keyframes bubble-float {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-600px) scale(0.8);
        opacity: 0;
    }
}

/* ======================
   CUSTOMIZATION EXAMPLES
   ====================== */

/* Large bubbles */
.bubbles .large {
    --size: 40px;
    --duration: 12s;
}

/* Small bubbles */
.bubbles .small {
    --size: 10px;
    --duration: 8s;
}

/* Colored bubbles */
.bubbles .blue {
    --color: rgba(66, 165, 245, 0.3);
}

.bubbles .green {
    --color: rgba(76, 175, 80, 0.3);
}

.bubbles .pink {
    --color: rgba(233, 30, 99, 0.3);
}

/* Faster bubbles */
.bubbles .fast {
    --duration: 6s;
}

/* Slower bubbles */
.bubbles .slow {
    --duration: 15s;
}

.signup-action, .login-action {
    display: none; /* Hidden on mobile to save space */
}

.form-section {
    flex: 1;
    padding: 30px 20px 40px;
    display: flex;
    flex-direction: column;
    background: var(--white);
    height: calc(100vh - 200px);
    overflow-y: auto;
}

.login-header {
    margin-bottom: 30px;
    text-align: center;
}

.signup-header {
    margin-bottom: 30px;
    text-align: center;
}

.login-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.signup-header h2 {
    margin-top: 300px;
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.5;
}

.signup-header p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.5;
}

.form-group, .signup-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group label, .signup-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input, .signup-group input {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background-color: var(--white);
    color: var(--text-primary);
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus, .signup-group input:focus {
    border-color: #78AE5F;
    box-shadow: 0 0 0 4px rgba(120, 174, 95, 0.1);
    outline: none;
    background-color: #fff;
}

.form-group input::placeholder, .signup-group input::placeholder {
    color: #aab2bd;
    font-weight: 400;
}

.forgot-password {
    display: block;
    text-align: center;
    margin: 10px 0 25px;
    font-size: 14px;
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    padding: 10px;
    touch-action: manipulation;
}

.forgot-password:hover {
    color: var(--primary-green-hover);
    text-decoration: underline;
}

/* Bubbles Container - BEHIND content */
.bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2; /* Above overlay but below content */
}

/* Individual Bubble */
.bubble {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    backdrop-filter: blur(5px);
}

/* Bubble sizes and positions */
.bubble:nth-child(1) {
    width: 40px;
    height: 40px;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 8s;
}

.bubble:nth-child(2) {
    width: 20px;
    height: 20px;
    left: 20%;
    animation-delay: 2s;
    animation-duration: 6s;
}

.bubble:nth-child(3) {
    width: 60px;
    height: 60px;
    left: 35%;
    animation-delay: 4s;
    animation-duration: 10s;
}

.bubble:nth-child(4) {
    width: 30px;
    height: 30px;
    left: 50%;
    animation-delay: 0s;
    animation-duration: 7s;
}

.bubble:nth-child(5) {
    width: 80px;
    height: 80px;
    left: 65%;
    animation-delay: 3s;
    animation-duration: 9s;
}

.bubble:nth-child(6) {
    width: 25px;
    height: 25px;
    left: 75%;
    animation-delay: 1s;
    animation-duration: 5s;
}

.bubble:nth-child(7) {
    width: 45px;
    height: 45px;
    left: 85%;
    animation-delay: 6s;
    animation-duration: 8s;
}

.bubble:nth-child(8) {
    width: 35px;
    height: 35px;
    left: 15%;
    animation-delay: 4s;
    animation-duration: 6s;
}

.bubble:nth-child(9) {
    width: 55px;
    height: 55px;
    left: 90%;
    animation-delay: 2s;
    animation-duration: 11s;
}

.bubble:nth-child(10) {
    width: 15px;
    height: 15px;
    left: 5%;
    animation-delay: 5s;
    animation-duration: 4s;
}

/* Float Animation */
@keyframes float {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

.login-login-button, .signup-button {
    background: linear-gradient(135deg, #3a7d44 0%, #5eae70 100%);
    color: var(--white);
    border: none;
    border-radius: 12px;
    padding: 18px 16px;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    font-family: inherit;
    touch-action: manipulation;
    min-height: 56px;
}

.login-login-button:hover, .signup-button:hover,
.login-login-button:active, .signup-button:active {
    background: linear-gradient(135deg, #5eae70 100%, #3a7d44 0%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

.password-toggle, .toggle-password {
    position: absolute;
    right: 20px;
    top: 50px;
    color: var(--text-light);
    cursor: pointer;
    font-size: 20px;
    transition: color 0.3s ease;
    padding: 5px;
    touch-action: manipulation;
}

.password-toggle:hover, .toggle-password:hover {
    color: var(--primary-green);
}

/* Password strength indicator */
.password-strength {
    height: 6px;
    margin-top: 8px;
    border-radius: 3px;
    background-color: var(--border-color);
    position: relative;
    overflow: hidden;
}

.password-strength::before {
    content: '';
    position: absolute;
    height: 100%;
    width: 0;
    background-color: var(--error-red);
    transition: width 0.3s ease, background-color 0.3s ease;
    border-radius: 3px;
}

.password-strength.weak::before {
    width: 30%;
    background-color: var(--error-red);
}

.password-strength.medium::before {
    width: 70%;
    background-color: #f59e0b;
}

.password-strength.strong::before {
    width: 100%;
    background-color: var(--success-green);
}

/* Error and success messages */
.error-message {
    color: #dc2626;
    background-color: var(--error-bg);
    padding: 12px 16px;
    border: 1px solid var(--error-border);
    border-radius: 8px;
    margin-top: 12px;
    font-size: 14px;
}

.success-message {
    color: var(--success-green);
    background-color: #f0fdf4;
    padding: 12px 16px;
    border: 1px solid var(--accent-green);
    border-radius: 8px;
    margin-top: 12px;
    font-size: 14px;
}

.error-box {
    background-color: var(--error-bg);
    border-left: 4px solid var(--error-red);
    color: #dc2626;
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
    animation: slideIn 0.3s ease-out;
}

.error-box p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

input.error {
    border-color: var(--error-red) !important;
    background-color: var(--error-bg) !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
}

.error-text {
    color: var(--error-red);
    font-size: 12px;
    margin-top: 6px;
    font-weight: 500;
}

.password-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-container input {
    flex: 1;
    padding-right: 55px;
}

/* Remove number input arrows */
.signup-group input[type="number"]::-webkit-inner-spin-button,
.signup-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Switch between login/signup link for mobile */
.mobile-switch {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.mobile-switch p {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 15px;
}

.mobile-switch a {
    display: inline-block;
    background: linear-gradient(135deg, #3a7d44 0%, #5eae70 100%);
    color: var(--white);
    padding: 14px 30px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    touch-action: manipulation;
}

.mobile-switch a:hover,
.mobile-switch a:active {
    background: linear-gradient(135deg, #5eae70 100%, #3a7d44 0%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
}

/* Loading states */
.login-login-button:disabled, .signup-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Accessibility improvements */
.login-login-button:focus-visible, .signup-button:focus-visible,
.mobile-switch a:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Tablet and larger screens */
@media (min-width: 768px) {
    body {
        align-items: stretch;
        padding: 0;
    }
    
    .login-container, .signup-container {
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        flex-direction: row;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
    }
    
    .image-section {
        flex: 0 0 65%; /* Make left side bigger - 65% of screen */
        width: 65%;
        padding: 60px;
        min-height: 100vh;
        height: 100vh;
        overflow-y: auto;
        text-align: left;
        justify-content: space-between;
    }
    
    .image-section h2 {
        font-size: 42px;
        margin-bottom: 20px;
    }
    
    .image-section p {
        margin-bottom: 30px;
        font-size: 18px;
    }
    
    .signup-action, .login-action {
        display: block;
        margin-top: auto;
        position: relative;
        z-index: 10;
    }
    
    .signup-action p, .login-action p {
        margin-bottom: 15px;
        font-weight: 500;
    }
    
    .signup-btn, .login-button {
        display: inline-block;
        background-color: var(--white);
        color: var(--primary-green);
        padding: 14px 32px;
        border-radius: 12px;
        text-decoration: none;
        font-weight: 600;
        font-size: 16px;
        transition: all 0.3s ease;
        box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
    }
    
    .signup-btn:hover, .login-button:hover {
        background-color: var(--primary-green-light);
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
    }
    
    .form-section {
        flex: 0 0 35%; /* Form section takes 35% of screen */
        width: 35%;
        padding: 60px 40px;
        height: 100vh;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .login-header {
        text-align: left;
        margin-bottom: 40px;
    }
    
    .signup-header {
        text-align: left;
        margin-bottom: 40px;
        margin-top: 50px;
    }
    
    .login-header h2 {
        font-size: 32px;
    }
    
    .forgot-password {
        text-align: right;
        margin: -8px 0 20px;
    }
    
    .mobile-switch {
        display: none;
    }
    
    .form-group input, .signup-group input {
        width: 100%;
        padding: 20px;
        font-size: 16px;
    }
    
    .login-login-button, .signup-button {
        padding: 20px 16px;
        font-size: 18px;
        margin-top: 10px;
    }
}

/* Large desktop screens - even bigger left side */
@media (min-width: 1200px) {
    .image-section {
        flex: 0 0 70%; /* 70% for very large screens */
        width: 70%;
        padding: 80px;
    }
    
    .form-section {
        flex: 0 0 30%; /* 30% for form */
        width: 30%;
        padding: 80px 50px;
    }
    
    .image-section h2 {
        font-size: 48px;
    }
    
    .image-section p {
        font-size: 20px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .form-group input, .signup-group input {
        border-width: 1px;
    }
}

/* Smooth transitions */
* {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .form-group input, .signup-group input {
        font-size: 16px; /* Prevents zoom on focus */
    }
}

/* Default: Hide it (for safety) */
.mobile-switch {
    display: none;
}

/* Show only on mobile (less than 768px) */
@media (max-width: 767px) {
    .mobile-switch {
        display: block;
        text-align: center;
        margin-top: 20px;
        font-size: 15px;
        color: var(--primary-dark);
    }

    .mobile-switch a {
        color: var(--primary);
        font-weight: 600;
        text-decoration: none;
        transition: var(--transition);
    }

    .mobile-switch a:hover {
        color: var(--primary-dark);
        text-decoration: underline;
    }
}