/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* Hide preloader for auth page */
.preload-wrapper .preload {
    display: none !important;
}

/* Auth Page Styles */
.auth-page-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #007bff 0%, #6f42c1 100%);
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(0, 123, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(111, 66, 193, 0.2) 0%, transparent 50%);
    position: relative;
    overflow: hidden;
    padding: 40px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Background Shapes */
.auth-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.shape-1 {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    animation: float 6s ease-in-out infinite;
}

.shape-2 {
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(-45deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    animation: float 8s ease-in-out infinite reverse;
}

.shape-3 {
    position: absolute;
    top: 50%;
    left: -100px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: float 10s ease-in-out infinite;
}

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

/* Logo Section */
.auth-logo-section {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    z-index: 10;
}

.auth-logo {
    display: inline-block;
    transition: transform 0.3s ease;
}

.auth-logo:hover {
    transform: scale(1.05);
}

.auth-logo img {
    max-height: 60px;
    max-width: 200px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

/* Auth Card */
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 10;
    overflow: hidden;
    padding: 2rem;
    margin: 0 auto;
    max-width: 550px;
    width: 100%;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #6f42c1, #e83e8c, #fd7e14);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #6f42c1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 123, 255, 0.3);
    animation: pulse 2s infinite;
}

.auth-icon i {
    font-size: 2rem;
    color: white;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.auth-title {
    color: #2d3748;
    font-weight: 700;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.auth-subtitle {
    color: #718096;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Login Switcher */
.login-switcher {
    text-align: center;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.switch-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.switch-btn.vendor-switch {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(32, 201, 151, 0.1));
    color: #28a745;
    border-color: rgba(40, 167, 69, 0.3);
}

.switch-btn.vendor-switch:hover {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.15), rgba(32, 201, 151, 0.15));
    color: #1e7e34;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.2);
    text-decoration: none;
}

.switch-btn.affiliate-switch {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 140, 0, 0.1));
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.3);
}

.switch-btn.affiliate-switch:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 140, 0, 0.15));
    color: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.2);
    text-decoration: none;
}

/* Modern Form Controls */
.tf-field {
    position: relative;
    margin-bottom: 1.5rem;
}

.tf-field input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    transition: all 0.3s ease;
    font-size: 1rem;
    outline: none;
}

.tf-field input:focus {
    border-color: #007bff;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    transform: translateY(-2px);
}

.tf-field input.is-invalid {
    border-color: #e53e3e;
}

.tf-field label {
    position: absolute;
    left: 3rem;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    font-weight: 500;
    transition: all 0.3s ease;
    pointer-events: none;
    background: transparent;
    padding: 0 4px;
}

.tf-field input:focus + label,
.tf-field input:not(:placeholder-shown) + label {
    top: 0;
    left: 1rem;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #007bff;
    background: white;
}

.tf-field i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    font-size: 1.1rem;
    z-index: 1;
}

/* Password Field */
.password-field {
    position: relative;
}

.password-field input {
    padding-right: 3.5rem;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    z-index: 10;
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.password-toggle-btn i {
    font-size: 1.1rem;
    line-height: 1;
    display: block;
    opacity: 1;
    color: inherit;
}

.password-toggle-btn:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.1);
    transform: translateY(-50%) scale(1.05);
}

.password-toggle-btn:hover i {
    color: #007bff;
}

.password-toggle-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3);
}

.password-toggle-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* Invalid feedback */
.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #e53e3e;
}

/* Form Check */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
}

.form-check-input:checked {
    background-color: #007bff;
    border-color: #007bff;
    transform: scale(1.1);
}

.form-check-label {
    color: #4a5568;
    font-weight: 500;
    cursor: pointer;
}

/* Auth Button */
.tf-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #007bff 0%, #6f42c1 100%);
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    margin-bottom: 1rem;
}

.tf-btn-primary::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;
}

.tf-btn-primary:hover::before {
    left: 100%;
}

.tf-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 123, 255, 0.4);
}

.tf-btn-primary:active {
    transform: translateY(-1px);
}

/* Outline Button */
.tf-btn-outline {
    width: 100%;
    background: transparent;
    border: 2px solid #007bff;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    color: #007bff;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.tf-btn-outline:hover {
    background: #007bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
    text-decoration: none;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.alert-danger {
    background: linear-gradient(135deg, #fed7d7, #feb2b2);
    color: #c53030;
}

.alert-success {
    background: linear-gradient(135deg, #c6f6d5, #9ae6b4);
    color: #2f855a;
}

.alert i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

/* Links */
.forgot-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.back-home-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}

.back-home-link:hover {
    color: white;
    transform: translateX(-5px);
    text-decoration: none;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-footer p {
    color: #4a5568;
    margin-bottom: 1rem;
}

/* Responsive Design */
/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .auth-card {
        max-width: 480px;
        padding: 1.75rem;
    }
}

/* Tablets */
@media (max-width: 768px) {
    .auth-page-wrapper {
        padding: 30px 15px;
    }
    
    .auth-card {
        padding: 1.5rem;
        border-radius: 15px;
        margin: 0;
        max-width: 100%;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-subtitle {
        font-size: 0.9rem;
    }

    .auth-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }

    .auth-icon i {
        font-size: 1.5rem;
    }

    .tf-field input {
        padding: 0.875rem 0.875rem 0.875rem 2.5rem;
        font-size: 0.95rem;
    }

    .tf-field label {
        left: 2.5rem;
        font-size: 0.9rem;
    }

    .tf-field i {
        left: 0.875rem;
        font-size: 1rem;
    }

    .password-field input {
        padding-right: 3rem;
    }

    .password-toggle-btn {
        right: 8px;
        width: 36px;
        height: 36px;
    }

    .password-toggle-btn i {
        font-size: 1rem;
    }

    .tf-btn-primary {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .tf-btn-outline {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }

    .switch-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
    }

    .login-switcher {
        gap: 0.3rem;
    }
}

/* Small tablets and large phones */
@media (max-width: 576px) {
    .auth-page-wrapper {
        padding: 20px 10px;
    }

    .auth-card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .auth-logo img {
        max-height: 45px;
    }

    .auth-title {
        font-size: 1.3rem;
    }

    .auth-subtitle {
        font-size: 0.85rem;
    }

    .auth-icon {
        width: 55px;
        height: 55px;
        margin-bottom: 0.75rem;
    }

    .auth-icon i {
        font-size: 1.3rem;
    }

    .tf-field {
        margin-bottom: 1.25rem;
    }

    .switch-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }

    .login-switcher {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .auth-page-wrapper {
        padding: 15px 8px;
    }

    .auth-card {
        padding: 1rem;
        border-radius: 10px;
    }

    .auth-logo img {
        max-height: 40px;
    }

    .auth-title {
        font-size: 1.2rem;
    }

    .auth-subtitle {
        font-size: 0.8rem;
        margin-bottom: 1rem;
    }

    .auth-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 0.5rem;
    }

    .auth-icon i {
        font-size: 1.2rem;
    }

    .tf-field input {
        padding: 0.75rem 0.75rem 0.75rem 2.25rem;
        font-size: 0.9rem;
    }

    .tf-field label {
        left: 2.25rem;
        font-size: 0.85rem;
    }

    .tf-field i {
        left: 0.75rem;
        font-size: 0.95rem;
    }

    .password-field input {
        padding-right: 2.75rem;
    }

    .password-toggle-btn {
        right: 6px;
        width: 32px;
        height: 32px;
    }

    .password-toggle-btn i {
        font-size: 0.9rem;
    }

    .tf-btn-primary {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        letter-spacing: 0.3px;
    }

    .tf-btn-outline {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .switch-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.65rem;
    }

    .form-check {
        margin-bottom: 0.75rem;
    }

    .form-check-input {
        width: 1.1rem;
        height: 1.1rem;
    }

    .form-check-label {
        font-size: 0.85rem;
    }

    .forgot-link {
        font-size: 0.8rem;
    }

    .alert {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .auth-footer p {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }
}

/* Extra small phones */
@media (max-width: 360px) {
    .auth-page-wrapper {
        padding: 10px 5px;
    }

    .auth-card {
        padding: 0.875rem;
    }

    .auth-title {
        font-size: 1.1rem;
    }

    .auth-subtitle {
        font-size: 0.75rem;
    }

    .tf-field input {
        padding: 0.625rem 0.625rem 0.625rem 2rem;
        font-size: 0.85rem;
    }

    .tf-field label {
        left: 2rem;
        font-size: 0.8rem;
    }

    .tf-field i {
        left: 0.625rem;
        font-size: 0.9rem;
    }

    .password-toggle-btn {
        width: 28px;
        height: 28px;
    }

    .password-toggle-btn i {
        font-size: 0.8rem;
    }

    .tf-btn-primary,
    .tf-btn-outline {
        padding: 0.625rem 1rem;
        font-size: 0.85rem;
    }
}

/* Loading state */
.tf-btn-primary.loading {
    pointer-events: none;
    opacity: 0.7;
}

.tf-btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}