/**
 * Authentication Pages Stylesheet
 * FastKeysBuy - Premium Digital Solutions
 */

/* ===== AUTH CONTAINER ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-4);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    position: relative;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.03"><circle cx="6" cy="6" r="2"/></g></svg>');
    animation: movePattern 20s linear infinite;
}

.auth-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
    max-width: 1000px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* ===== AUTH CARD ===== */
.auth-card {
    background: white;
    padding: var(--space-12);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--space-6);
    text-decoration: none;
}

.auth-logo i {
    font-size: var(--font-size-3xl);
}

.auth-header h2 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-4);
}

.auth-header p {
    color: var(--gray-600);
    font-size: var(--font-size-base);
    line-height: 1.6;
}

/* ===== ALERTS ===== */
.alert {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.alert i {
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fed7aa;
}

.alert-info {
    background: #f0f9ff;
    color: #1e40af;
    border: 1px solid #bae6fd;
}

/* ===== FORM STYLES ===== */
.auth-form {
    margin-bottom: var(--space-8);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.form-group {
    margin-bottom: var(--space-6);
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: var(--space-4);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    transition: all 0.3s ease;
    outline: none;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.form-group small {
    display: block;
    color: var(--gray-500);
    font-size: var(--font-size-xs);
    margin-top: var(--space-1);
}

/* ===== INPUT WITH ICONS ===== */
.input-icon {
    position: relative;
}

.input-icon > i {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    z-index: 10;
}

.input-icon input {
    padding-left: calc(var(--space-4) + 20px + var(--space-2));
}

/* ===== PASSWORD INPUT ===== */
.password-input {
    position: relative;
    display: flex;
}

.password-input input {
    flex: 1;
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: var(--space-2);
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--gray-600);
}

/* ===== CHECKBOX STYLES ===== */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
    font-size: var(--font-size-sm);
    line-height: 1.5;
    margin-bottom: var(--space-1);
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: background-color 0.3s ease;
}

.checkbox-label:hover {
    background: var(--gray-50);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-sm);
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
    margin-top: 2px;
    background: white;
    display: inline-block;
}

.checkbox-label input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: var(--font-size-xs);
}

/* ===== FORM OPTIONS ===== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.forgot-password {
    color: var(--primary-color);
    font-size: var(--font-size-sm);
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== AUTH BUTTON ===== */
.auth-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    padding: var(--space-4) var(--space-6);
    border: none;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.auth-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== DIVIDER ===== */
.auth-divider {
    text-align: center;
    margin: var(--space-8) 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gray-200);
}

.auth-divider span {
    background: white;
    color: var(--gray-500);
    padding: 0 var(--space-4);
    font-size: var(--font-size-sm);
    position: relative;
    z-index: 1;
}

/* ===== SOCIAL LOGIN ===== */
.social-login {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-8);
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: white;
    color: var(--gray-700);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.social-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.google-btn i {
    color: #db4437;
}

.facebook-btn i {
    color: #4267b2;
}

/* ===== AUTH FOOTER ===== */
.auth-footer {
    text-align: center;
    border-top: 1px solid var(--gray-200);
    padding-top: var(--space-6);
}

.auth-footer p {
    color: var(--gray-600);
    font-size: var(--font-size-sm);
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== AUTH BENEFITS ===== */
.auth-benefits {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: var(--space-12);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-benefits h3 {
    color: white;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-8);
    text-align: center;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
    color: white;
}

.benefit-item:last-child {
    margin-bottom: 0;
}

.benefit-item i {
    background: var(--secondary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    flex-shrink: 0;
}

.benefit-item h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.benefit-item p {
    font-size: var(--font-size-sm);
    opacity: 0.9;
    line-height: 1.5;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .auth-wrapper {
        grid-template-columns: 1fr;
        gap: var(--space-12);
        max-width: 500px;
    }
    
    .auth-benefits {
        order: -1;
    }
}

@media (max-width: 768px) {
    .auth-container {
        padding: var(--space-4);
    }
    
    .auth-card {
        padding: var(--space-8);
    }
    
    .auth-benefits {
        padding: var(--space-8);
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    
    .social-login {
        gap: var(--space-2);
    }
}

@media (max-width: 480px) {
    .auth-header h2 {
        font-size: var(--font-size-2xl);
    }
    
    .auth-logo {
        font-size: var(--font-size-xl);
    }
    
    .benefit-item {
        gap: var(--space-3);
    }
    
    .benefit-item i {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-lg);
    }
}

/* ===== LOADING STATES ===== */
.auth-btn.loading {
    position: relative;
    color: transparent;
}

.auth-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    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); }
}

/* ===== VALIDATION STATES ===== */
.form-group.error input,
.form-group.error select {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group.success input,
.form-group.success select {
    border-color: var(--success-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group .error-message {
    color: var(--error-color);
    font-size: var(--font-size-xs);
    margin-top: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.form-group .success-message {
    color: var(--success-color);
    font-size: var(--font-size-xs);
    margin-top: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* ===== ANIMATIONS ===== */
.auth-card {
    animation: slideInUp 0.6s ease-out;
}

.auth-benefits {
    animation: slideInLeft 0.6s ease-out 0.2s both;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    .auth-card,
    .auth-benefits {
        animation: none;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .auth-container {
        background: white;
        color: black;
    }
    
    .auth-benefits {
        display: none;
    }
}
