﻿/* Animated Background - Forest Green Theme */
.particles-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #2d5a32 0%, #1a3d1f 25%, #0f2912 50%, #1a3d1f 75%, #2d5a32 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Main Container */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.app-brand {
    margin-bottom: 1rem;
}

.app-brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease;
}

    .app-brand-link:hover {
        transform: scale(1.05);
    }

.logo-img {
    height: 60px;
    width: auto;
    margin-right: 1rem;
}

.app-brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.login-tagline h1 {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.login-tagline p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* Form Container */
.form-container {
    background: #fff;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    min-height: 400px;
    position: relative;
}

/* Alert Styling */
.alert {
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    font-size: 0.9rem;
}

.alert-info {
    background-color: rgba(57, 105, 64, 0.1);
    border: 1px solid rgba(57, 105, 64, 0.3);
    color: #396940;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

/* Login Method Toggle */
.login-method-toggle {
    margin-bottom: 1.5rem;
}

.login-method-toggle .btn-group {
    border-radius: 0.5rem;
    overflow: hidden;
}

.login-method-toggle .btn {
    border: 2px solid #396940;
    color: #396940;
    background: transparent;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-method-toggle .btn:hover {
    background-color: rgba(57, 105, 64, 0.1);
}

.login-method-toggle .btn-check:checked + .btn {
    background-color: #396940;
    color: #fff;
    border-color: #396940;
}

/* Style for disabled OTP option */
.login-method-toggle input[type="radio"]:disabled + label {
    opacity: 0.6;
    cursor: not-allowed;
    position: relative;
}

.login-method-toggle input[type="radio"]:disabled + label:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

/* Add a subtle pattern to indicate coming soon */
.login-method-toggle input[type="radio"]:disabled + label::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.05) 2px,
        rgba(0,0,0,0.05) 4px
    );
    pointer-events: none;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

/* Input Styling */
.form-control {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #396940;
    box-shadow: 0 0 0 0.2rem rgba(57, 105, 64, 0.25);
}

.form-control.is-valid {
    border-color: #396940;
    box-shadow: 0 0 0 0.2rem rgba(57, 105, 64, 0.25);
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Phone Input Layout */
.country-phone-input {
    display: flex;
    gap: 0.75rem;
}

.country-code-select {
    flex: 0 0 130px;
    width: 130px;
    padding: 0.875rem 0.5rem;
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
    box-sizing: border-box;
}

.country-code-select:focus {
    outline: none;
    border-color: #396940;
    box-shadow: 0 0 0 0.2rem rgba(57, 105, 64, 0.25);
}

.phone-input {
    flex: 1;
}

/* Input Group with Button */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 2px solid #396940;
}

/* Password Toggle Button */
.btn-outline-secondary {
    color: #666;
    border-color: #e9ecef;
    background-color: #fff;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    color: #396940;
    border-color: #396940;
    background-color: rgba(57, 105, 64, 0.1);
}

/* Validation Indicators */
.validation-indicator {
    margin-top: 0.5rem;
    min-height: 1.5rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.validation-indicator.valid {
    color: #396940;
}

.validation-indicator.invalid {
    color: #dc3545;
}

.validation-indicator:empty {
    display: none;
}

/* Validation icon styling */
.validation-indicator.valid::before {
    content: '✓ ';
    color: #396940;
    font-weight: bold;
}

.validation-indicator.invalid::before {
    content: '✗ ';
    color: #dc3545;
    font-weight: bold;
}

/* Smooth animations for validation feedback */
.validation-indicator {
    opacity: 0;
    transform: translateY(-5px);
    animation: fadeInUp 0.3s ease forwards;
}

.validation-indicator:empty {
    opacity: 0;
    animation: none;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* OTP Section */
.otp-section {
    display: none;
    margin-bottom: 1.5rem;
}

.otp-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Remember Me Checkbox */
.form-check {
    margin-bottom: 1.5rem;
}

.form-check-input {
    border-color: #396940;
}

.form-check-input:checked {
    background-color: #396940;
    border-color: #396940;
}

.form-check-label {
    color: #333;
    font-size: 0.9rem;
}

/* Submit Button */
.btn-primary {
    background-color: #396940;
    border-color: #396940;
    color: #fff;
    padding: 0.875rem 1.5rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background-color: #2d5a32;
    border-color: #2d5a32;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(57, 105, 64, 0.25);
}

.btn-primary:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Loading Spinner */
.bx-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer Links */
.text-primary {
    color: #396940 !important;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.text-primary:hover {
    color: #2d5a32 !important;
    text-decoration: underline;
}

/* Countdown Display */
#countdown-display {
    background: rgba(57, 105, 64, 0.1);
    border: 1px solid rgba(57, 105, 64, 0.3);
    border-radius: 0.5rem;
    padding: 0.75rem;
    text-align: center;
}

/* Error Message Styling */
.text-danger {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success Message Styling */
.text-success {
    color: #396940;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: 1rem;
    }

    .login-tagline h1 {
        font-size: 2rem;
    }

    .form-container {
        padding: 1.5rem;
        max-width: 100%;
    }

    .country-phone-input {
        flex-direction: column;
        gap: 0.75rem;
    }

    .country-code-select {
        flex: none;
        width: 100%;
    }

    .login-method-toggle .btn {
        font-size: 0.85rem;
        padding: 0.5rem;
    }

    .otp-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .login-header {
        margin-bottom: 1rem;
    }

    .app-brand-text {
        font-size: 1.2rem;
    }

    .login-tagline h1 {
        font-size: 1.8rem;
    }

    .form-container {
        padding: 1rem;
        min-height: 350px;
    }
}
