/* Cognito Social Login - Modern Frontend Styles */

.csl-login-container {
    max-width: 480px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.csl-auth-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.csl-auth-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.csl-tab-container {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
}

.csl-tab {
    flex: 1;
    padding: 16px 24px;
    text-align: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.3s ease;
    position: relative;
}

.csl-tab:hover {
    color: #495057;
    background: rgba(0, 0, 0, 0.02);
}

.csl-tab.active {
    color: #007bff;
    background: #ffffff;
}

.csl-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: #007bff;
    border-radius: 2px 2px 0 0;
}

.csl-form-content {
    padding: 32px;
}

.csl-form-content h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: #212529;
    text-align: center;
}

.csl-form-content .csl-subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 24px;
    font-size: 14px;
}

/* Social Buttons */
.csl-social-buttons {
    margin-bottom: 24px;
}

.csl-social-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: #6c757d;
    font-size: 14px;
}

.csl-social-divider::before,
.csl-social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e9ecef;
}

.csl-social-divider span {
    padding: 0 16px;
}

.csl-social-btn {
    width: 100%;
    padding: 12px 20px;
    margin-bottom: 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #495057;
    position: relative;
    overflow: hidden;
}

.csl-social-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.csl-social-btn:hover::before {
    left: 100%;
}

.csl-social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #dee2e6;
}

.csl-social-btn:active {
    transform: translateY(0);
}

.csl-social-btn .csl-icon {
    margin-right: 12px;
    font-size: 20px;
    font-weight: bold;
    width: 24px;
    text-align: center;
}

.csl-facebook {
    background: #1877f2;
    color: #ffffff;
    border-color: #1877f2;
}

.csl-facebook:hover {
    background: #166fe5;
    border-color: #166fe5;
    color: #ffffff;
}

.csl-google {
    background: #ffffff;
    color: #495057;
}

.csl-google:hover {
    background: #f8f9fa;
}

.csl-apple {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.csl-apple:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #ffffff;
}

/* Form Styles */
.csl-form {
    margin-top: 0;
}

.csl-form-group {
    margin-bottom: 20px;
}

.csl-password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.csl-password-field input[type="password"],
.csl-password-field input[type="text"] {
    width: 100%;
    padding-right: 44px;
}

.csl-toggle-password {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    transition: color 0.2s ease;
}

.csl-toggle-password:hover {
    color: #212529;
}

.csl-toggle-password:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
    border-radius: 50%;
}

.csl-toggle-password .dashicons {
    font-size: 18px;
    line-height: 1;
}

.csl-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.csl-form-group input[type="text"],
.csl-form-group input[type="email"],
.csl-form-group input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #ffffff;
    box-sizing: border-box;
}

.csl-form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.csl-form-group input::placeholder {
    color: #adb5bd;
}

/* Remember Me Checkbox */
.csl-remember-me {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
    margin-bottom: 0;
    user-select: none;
}

.csl-remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #007bff;
    flex-shrink: 0;
}

.csl-remember-me span {
    font-size: 14px;
    color: #495057;
    line-height: 1.5;
}

.csl-remember-me:hover span {
    color: #212529;
}

/* Terms Checkbox */
.csl-terms-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: 400;
    margin-bottom: 0;
    user-select: none;
}

.csl-terms-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #007bff;
    flex-shrink: 0;
}

.csl-terms-checkbox span {
    font-size: 13px;
    color: #495057;
    line-height: 1.6;
}

.csl-terms-checkbox span a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.csl-terms-checkbox span a:hover {
    text-decoration: underline;
}

.csl-terms-checkbox:hover span {
    color: #212529;
}

/* Button Styles */
.csl-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.csl-btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.csl-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.4);
}

.csl-btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.csl-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Message Styles */
.csl-message {
    margin-top: 16px;
    min-height: 20px;
}

.csl-success {
    padding: 12px 16px;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.csl-success::before {
    content: '✓';
    margin-right: 8px;
    font-weight: bold;
    font-size: 16px;
}

.csl-error {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.csl-error::before {
    content: '✕';
    margin-right: 8px;
    font-weight: bold;
    font-size: 16px;
}

/* Tab Content */
.csl-tab-content {
    display: none;
}

.csl-tab-content.active {
    display: block !important;
    animation: fadeIn 0.3s ease;
}

/* Ensure first tab is visible on page load - fallback if JS hasn't loaded yet */
.csl-form-content > .csl-tab-content:first-of-type.active {
    display: block !important;
}

/* Hide register tab by default if login is active */
.csl-tab-content:not(.active) {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Email Confirmation Message */
.csl-email-confirmation {
    background: #e7f3ff;
    border: 2px solid #b3d9ff;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.csl-email-confirmation h4 {
    margin: 0 0 12px 0;
    color: #0056b3;
    font-size: 18px;
}

.csl-email-confirmation p {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 14px;
}

.csl-email-confirmation .csl-email-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

/* Responsive */
@media (max-width: 480px) {
    .csl-login-container {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .csl-form-content {
        padding: 24px 20px;
    }
    
    .csl-tab {
        padding: 14px 16px;
        font-size: 14px;
    }
}

/* Loading Spinner */
.csl-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.csl-btn-primary .csl-loading {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
}
