/* Authentication Pages CSS - Matching Dashboard Design */

/* Import Dashboard Color Scheme */
:root {
    --primary-purple: #8b5cf6;
    --primary-pink: #ec4899;
    --accent-violet: #a855f7;
    --accent-rose: #f43f5e;
    --light-bg: #fdf7ff;
    --lighter-bg: #f3e8ff;
    --purple-bg: #f8faff;
    --section-bg: #f1f0ff;
    --text-light: #ffffff;
    --text-dark: #374151;
    --wall-stone: #9ca3af;
    
    /* Auth specific colors */
    --auth-card-bg: #ffffff;
    --auth-border-color: #e5e7eb;
    --auth-hover-bg: #f9fafb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    
    /* Gradients */
    --primary-gradient: linear-gradient(135deg, var(--primary-purple), var(--primary-pink));
    --brand-gradient: linear-gradient(135deg, var(--lighter-bg), var(--purple-bg));
    --card-gradient: linear-gradient(145deg, var(--light-bg), var(--lighter-bg));
}

/* Base Auth Styles */
.auth-body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--brand-gradient);
    min-height: 100vh;
    overflow-x: hidden;
}

.auth-container {
    min-height: 100vh;
}

/* Brand Side Styling */
.auth-brand-side {
    background: var(--primary-gradient);
    color: var(--text-light);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.auth-brand-side::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="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.auth-brand-content {
    padding: 2rem;
    position: relative;
    z-index: 2;
    max-width: 500px;
    margin: 0 auto;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.brand-logo img {
    max-height: 120px;
    width: auto;
    filter: brightness(0) invert(1); /* Make logo white on dark background */
}

.brand-logo.with-text img {
    max-height: 100px;
}

.brand-logo.icon-only img {
    max-height: 120px;
}

.brand-logo.login-page img {
    max-height: 250px;
}

/* Fallback for Font Awesome icon (if image fails to load) */
.brand-logo i {
    font-size: 3rem;
    color: var(--text-light);
    display: none; /* Hidden by default when using images */
}

.brand-logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-light);
    display: none; /* Hidden when using logo with text */
}

.brand-logo.icon-only h1 {
    display: block; /* Show text when using icon-only logo */
    margin-left: 1rem;
}

.brand-tagline h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-light);
}

.brand-tagline .lead {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
}

.brand-features {
    margin-top: 3rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.feature-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    opacity: 0.9;
}

.feature-item span {
    font-weight: 500;
}

.brand-stats {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    gap: 1rem;
}

.stat-item {
    text-align: center;
}

.stat-item h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.stat-item span {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Form Side Styling */
.auth-form-side {
    background: var(--auth-card-bg);
    display: flex;
    align-items: center;
    padding: 2rem;
}

.auth-form-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.auth-form-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-form-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.auth-form-header p {
    color: var(--wall-stone);
    font-size: 1rem;
}

/* Form Styling */
.auth-form {
    margin-bottom: 1.5rem;
}

.auth-form .form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.auth-form .form-control,
.auth-form .form-select {
    border: 2px solid var(--auth-border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-form .form-control:focus,
.auth-form .form-select:focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.25);
    outline: none;
}

.input-group-text {
    background: var(--lighter-bg);
    border: 2px solid var(--auth-border-color);
    border-right: none;
    color: var(--primary-purple);
}

.auth-submit-btn {
    background: var(--primary-gradient);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    width: 100%;
    transition: all 0.3s ease;
    color: var(--text-light);
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
    color: var(--text-light);
}

.auth-submit-btn:disabled {
    background: var(--wall-stone);
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

/* Links */
.auth-link {
    color: var(--primary-purple);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: var(--accent-violet);
    text-decoration: underline;
}

/* Divider */
.auth-divider {
    text-align: center;
    margin: 2rem 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--auth-border-color);
    z-index: 1;
}

.auth-divider span {
    background: var(--auth-card-bg);
    padding: 0 1rem;
    color: var(--wall-stone);
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
    display: inline-block;
}

/* Customer Context Preview */
.customer-context-preview {
    margin-top: 1.5rem;
}

.customer-option {
    padding: 1rem;
    border: 1px solid var(--auth-border-color);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.customer-option:hover {
    border-color: var(--primary-purple);
    background: var(--lighter-bg);
}

.customer-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.customer-info strong {
    color: var(--text-dark);
}

/* Demo Section */
.demo-section {
    padding-top: 1.5rem;
    border-top: 1px solid var(--auth-border-color);
}

.demo-section h6 {
    color: var(--wall-stone);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

/* Registration Steps */
.registration-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3rem;
    gap: 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--auth-border-color);
    color: var(--wall-stone);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: var(--primary-gradient);
    color: var(--text-light);
}

.step span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--wall-stone);
}

.step.active span {
    color: var(--text-dark);
}

/* Plan Selection */
.plan-selection {
    margin: 2rem 0;
}

.plan-card {
    border: 2px solid var(--auth-border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: var(--auth-card-bg);
    height: 100%;
}

.plan-card:hover {
    border-color: var(--primary-purple);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.15);
}

.plan-card.selected {
    border-color: var(--primary-purple);
    background: var(--lighter-bg);
}

.plan-card.popular {
    border-color: var(--primary-purple);
    background: var(--card-gradient);
}

.plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-gradient);
    color: var(--text-light);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.plan-header h4 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.plan-price {
    margin-bottom: 1.5rem;
}

.plan-price .price {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-purple);
}

.plan-price .period {
    font-size: 1rem;
    color: var(--wall-stone);
    font-weight: 500;
}

.plan-features {
    text-align: left;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.feature i {
    color: var(--success-color);
    font-size: 0.9rem;
    width: 16px;
}

/* Selected Plan Summary */
.selected-plan-summary {
    background: var(--lighter-bg);
    border: 1px solid var(--primary-purple);
    border-radius: 8px;
    padding: 1.5rem;
}

.selected-plan-summary h5 {
    color: var(--primary-purple);
    margin-bottom: 1rem;
}

/* Stripe Card Element */
.stripe-card-element {
    border: 2px solid var(--auth-border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    background: var(--auth-card-bg);
    transition: border-color 0.3s ease;
}

.stripe-card-element.StripeElement--focus {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.25);
}

.stripe-card-element.StripeElement--invalid {
    border-color: var(--error-color);
}

/* Payment Security */
.payment-security {
    text-align: center;
}

.security-badges {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.security-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--wall-stone);
}

.security-item i {
    font-size: 1.5rem;
    color: var(--success-color);
}

.security-item span {
    font-size: 0.8rem;
    font-weight: 500;
}

/* Password Strength */
.password-strength .progress {
    border-radius: 4px;
    overflow: hidden;
}

.password-strength .progress-bar {
    transition: all 0.3s ease;
}

.password-strength.weak .progress-bar {
    background-color: var(--error-color);
    width: 25%;
}

.password-strength.medium .progress-bar {
    background-color: var(--warning-color);
    width: 50%;
}

.password-strength.strong .progress-bar {
    background-color: var(--success-color);
    width: 100%;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    text-align: center;
    color: var(--text-dark);
}

.loading-spinner .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Terms Agreement */
.terms-agreement {
    font-size: 0.9rem;
}

.terms-agreement .form-check-label {
    color: var(--wall-stone);
    line-height: 1.5;
}

/* Trial Info */
.trial-info .alert {
    background: var(--card-gradient);
    border: 1px solid var(--primary-purple);
    color: var(--text-dark);
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .auth-brand-side {
        display: none;
    }
    
    .auth-form-side {
        padding: 1rem;
    }
    
    .registration-steps {
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .step span {
        display: none;
    }
    
    .brand-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .security-badges {
        gap: 1rem;
    }
}

@media (max-width: 767.98px) {
    .auth-form-container {
        max-width: 100%;
    }
    
    .plan-card {
        margin-bottom: 1rem;
    }
    
    .registration-steps {
        gap: 0.5rem;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* Alternative Auth Actions */
.auth-alternative {
    text-align: center;
    padding-top: 1rem;
}

.auth-alternative p {
    margin: 0;
    color: var(--wall-stone);
}

/* Form Validation Styles */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--error-color);
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: var(--success-color);
}

.invalid-feedback {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.valid-feedback {
    color: var(--success-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}
