/* Octo Letaca Forms CSS */

.octo-form {
    margin-bottom: 2em;
    max-width: 500px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="password"],
.form-row input[type="number"],
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.description {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.required {
    color: #d63384;
}

.octo-form .button {
    background-color: var(--e-global-color-primary) !important;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease;
    width: 100%;
}

.octo-form .button:hover {
    transform: scale(1.05);
}

.octo-form .button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Affiliate Code Field Specific Styles */
.affiliate-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

#affiliate_code {
    padding-right: 45px !important;
}

#affiliate_code:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.affiliate-validation-indicator {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

/* Validation States */
.affiliate-validation-indicator.checking {
    display: flex;
    background: #ffc107;
    color: white;
}

.affiliate-validation-indicator.checking::after {
    content: "⏳";
}

.affiliate-validation-indicator.valid {
    display: flex;
    background: #28a745;
    color: white;
}

.affiliate-validation-indicator.valid::after {
    content: "✓";
}

.affiliate-validation-indicator.invalid {
    display: flex;
    background: #dc3545;
    color: white;
}

.affiliate-validation-indicator.invalid::after {
    content: "✗";
}

.affiliate-validation-indicator.empty {
    display: none;
}

/* Input border colors for validation */
#affiliate_code.checking {
    border-color: #ffc107;
}

#affiliate_code.valid {
    border-color: #28a745;
}

#affiliate_code.invalid {
    border-color: #dc3545;
}

/* Loading animation for checking state */
@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

.affiliate-validation-indicator.checking {
    animation: spin 1s linear infinite;
}

.affiliate-validation-indicator.checking::after {
    content: "↻";
    animation: none;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .octo-form {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .form-row input[type="text"],
    .form-row input[type="email"],
    .form-row input[type="password"],
    .form-row input[type="number"],
    .form-row select,
    .form-row textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Success message styling */
.affiliate-success-message {
    margin-top: 8px;
    padding: 8px 12px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.affiliate-success-message.show {
    display: block;
}

/* Error message styling */
.affiliate-error-message {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-size: 14px;
    display: none;
}

.affiliate-error-message.show {
    display: block;
}