/**
 * Auth Button & Modal Styles
 */

/* Auth Button Wrapper */
.woo-aff-auth-wrapper {
    display: inline-block;
    position: relative;
}

/* Login Button */
.woo-aff-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.woo-aff-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

/* Account Dropdown */
.woo-aff-account-dropdown {
    position: relative;
}

.woo-aff-account-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.woo-aff-account-btn:hover {
    border-color: #4F46E5;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.woo-aff-account-btn img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.woo-aff-account-btn svg {
    transition: transform 0.2s ease;
}

.woo-aff-account-dropdown:hover .woo-aff-account-btn svg {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.woo-aff-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 9999;
    overflow: hidden;
}

.woo-aff-account-dropdown:hover .woo-aff-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.woo-aff-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.woo-aff-dropdown-header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.woo-aff-dropdown-header strong {
    display: block;
    font-size: 14px;
    color: #1e293b;
}

.woo-aff-dropdown-header small {
    display: block;
    font-size: 12px;
    color: #64748b;
}

.woo-aff-dropdown-divider {
    height: 1px;
    background: #e2e8f0;
}

.woo-aff-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s ease;
}

.woo-aff-dropdown-item:hover {
    background: #f8fafc;
    color: #4F46E5;
}

.woo-aff-dropdown-item svg {
    flex-shrink: 0;
    color: #94a3b8;
}

.woo-aff-dropdown-item:hover svg {
    color: #4F46E5;
}

.woo-aff-dropdown-logout:hover {
    background: #fef2f2;
    color: #dc2626;
}

.woo-aff-dropdown-logout:hover svg {
    color: #dc2626;
}

/* Auth Modal */
.woo-aff-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.woo-aff-auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
}

.woo-aff-auth-modal-container {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.woo-aff-auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.woo-aff-auth-modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Auth Form */
.woo-aff-auth-form {
    padding: 32px;
}

.woo-aff-auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.woo-aff-auth-header h3 {
    margin: 0 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
}

.woo-aff-auth-header p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

/* Messages */
.woo-aff-auth-message {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

.woo-aff-auth-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.woo-aff-auth-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Form Styles */
.woo-aff-form {
    margin: 0;
}

.woo-aff-form-group {
    margin-bottom: 16px;
}

.woo-aff-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}

.woo-aff-form-group label .required {
    color: #dc2626;
}

.woo-aff-form-group input,
.woo-aff-form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.woo-aff-form-group input:focus,
.woo-aff-form-group select:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.woo-aff-form-group input::placeholder {
    color: #94a3b8;
}

.woo-aff-form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.woo-aff-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

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

.woo-aff-password-field input {
    padding-right: 48px;
}

.woo-aff-toggle-password {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.woo-aff-toggle-password:hover {
    color: #4F46E5;
}

/* Checkbox */
.woo-aff-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
}

.woo-aff-checkbox input {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #4F46E5;
    flex-shrink: 0;
}

.woo-aff-checkbox a {
    color: #4F46E5;
    text-decoration: none;
}

.woo-aff-checkbox a:hover {
    text-decoration: underline;
}

/* Checkbox Highlight (CTV) */
.woo-aff-checkbox-highlight {
    padding: 14px 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border: 1px solid #fcd34d;
    border-radius: 10px;
    margin-bottom: 16px;
}

.woo-aff-checkbox-highlight input {
    margin-top: 2px;
}

.woo-aff-checkbox-highlight span {
    flex: 1;
}

.woo-aff-checkbox-highlight strong {
    display: block;
    color: #92400e;
    font-size: 14px;
}

.woo-aff-checkbox-highlight small {
    display: block;
    color: #a16207;
    font-size: 12px;
    margin-top: 2px;
}

/* Affiliate Fields */
#woo-aff-affiliate-fields {
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.woo-aff-affiliate-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #dbeafe;
    border-radius: 8px;
    font-size: 13px;
    color: #1e40af;
    margin-bottom: 16px;
}

.woo-aff-affiliate-notice svg {
    flex-shrink: 0;
    color: #3b82f6;
}

/* Link */
.woo-aff-link {
    color: #4F46E5;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.woo-aff-link:hover {
    text-decoration: underline;
}

/* Buttons */
.woo-aff-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.woo-aff-btn-primary {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.woo-aff-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.woo-aff-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.woo-aff-btn-block {
    width: 100%;
}

.btn-loading .spinner {
    animation: spin 1s linear infinite;
}

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

/* Auth Footer */
.woo-aff-auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    font-size: 14px;
    color: #64748b;
}

/* Success Form */
.woo-aff-auth-success {
    padding: 20px 0;
}

.woo-aff-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.woo-aff-success-icon svg {
    color: #059669;
}

.woo-aff-auth-success h3 {
    color: #059669;
}

/* Responsive */
@media (max-width: 480px) {
    .woo-aff-auth-modal-container {
        border-radius: 12px;
    }
    
    .woo-aff-auth-form {
        padding: 24px 20px;
    }
    
    .woo-aff-form-row-2 {
        grid-template-columns: 1fr;
    }
    
    .woo-aff-form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .woo-aff-dropdown-menu {
        min-width: 200px;
    }
}
