/**
 * Activation Page Styles
 * RTL-optimized styles for the Salla webhook activation flow
 */

/* Global Font */
body {
    font-family: 'Effra', sans-serif;
}

/* Container Styles */
.activation-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

/* Loading Spinner */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f3f4f6;
    border-top-color: #8685E3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Form Styles */
.form-control {
    font-family: 'Effra', sans-serif;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #8685E3;
    box-shadow: 0 0 0 3px rgba(134, 133, 227, 0.1);
}

.form-group label {
    color: #374151;
}

/* Button Styles */
.btn-primary {
    background-color: #8685E3;
    color: white;
    font-family: 'Effra', sans-serif;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover:not(:disabled) {
    background-color: #6E6DD8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(134, 133, 227, 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-link {
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
}

.btn-link:hover {
    text-decoration: none;
}

/* OTP Input Styles */
.otp-input-group {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    direction: ltr;
}

.otp-digit {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.otp-digit:focus {
    outline: none;
    border-color: #8685E3;
    box-shadow: 0 0 0 3px rgba(134, 133, 227, 0.1);
}

.otp-digit:not(:placeholder-shown) {
    border-color: #8685E3;
    background-color: #f9fafb;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
}

.strength-bar-container {
    width: 100%;
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.strength-text {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* Password Requirements */
.password-requirements {
    background-color: #f9fafb;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    transition: color 0.3s ease;
}

.requirement-item.text-growth-green-primary {
    color: #10b981;
}

.requirement-item i {
    flex-shrink: 0;
}

/* Password Toggle Button */
.password-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.password-toggle:hover i {
    color: #8685E3 !important;
}

/* Product Cards Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.product-card {
    position: relative;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-card:not(.disabled):hover {
    border-color: #8685E3;
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(134, 133, 227, 0.2);
}

.product-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.product-card-content {
    position: relative;
    z-index: 1;
}

.product-card h3 {
    color: #1f2937;
    margin-bottom: 1rem;
}

.disabled-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: 'Effra', sans-serif;
    font-weight: 600;
    z-index: 2;
}

/* Error and Success Messages */
.error-message {
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Effra', sans-serif;
    font-weight: 500;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Attempts Remaining */
.attempts-remaining {
    color: #dc2626;
    font-weight: 600;
}

/* Success Animation */
.success-animation {
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Email Display */
.email-display {
    color: #8685E3;
    direction: ltr;
}

/* Resend Section */
.resend-section {
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .activation-container {
        padding: 1.5rem;
    }

    .otp-input-group {
        gap: 0.5rem;
    }

    .otp-digit {
        width: 40px;
        height: 50px;
        font-size: 1.25rem;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .activation-container {
        padding: 1rem;
        border-radius: 8px;
    }

    .otp-input-group {
        gap: 0.375rem;
    }

    .otp-digit {
        width: 35px;
        height: 45px;
        font-size: 1.125rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .btn-primary {
        padding: 0.75rem 1rem;
    }
}

/* Phone Input with Prefix */
.form-group .relative input[type="tel"] {
    padding-right: 4rem;
}

.form-group .relative span {
    font-weight: 600;
    color: #6b7280;
    pointer-events: none;
}

/* RTL Specific Adjustments */
[dir="rtl"] .password-toggle {
    left: auto;
    right: 0.75rem;
}

[dir="rtl"] .requirement-item {
    flex-direction: row-reverse;
}

/* Loading State for Buttons */
.btn-spinner {
    display: inline-block;
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid #8685E3;
    outline-offset: 2px;
}

/* Email Validation States */
.form-control.is-valid {
    border-color: #10b981 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310b981' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 1rem 1rem;
    padding-left: 2.5rem;
}

[dir="rtl"] .form-control.is-valid {
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    padding-left: 1rem;
}

.form-control.is-invalid {
    border-color: #ef4444 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23ef4444' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 0.75rem center;
    background-size: 1rem 1rem;
    padding-left: 2.5rem;
}

[dir="rtl"] .form-control.is-invalid {
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
    padding-left: 1rem;
}

.form-control.is-valid:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-control.is-invalid:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}